code: def test_cancel_query_failed(engine_mock: Mock) -> None:
      from superset.db_engine_specs.mysql import MySQLEngineSpec
      from superset.models.sql_lab import Query
  
      query = Query()
      cursor_mock = engine_mock.raiseError.side_effect = Exception()
      assert (
          MySQLEngineSpec.cancel_query(cursor_mock, query, "123")
          is False
      )
  
file_path: superset/tests/unit_tests/db_engine_specs/test_mysql.py
imports: from datetime import datetime
  from decimal import Decimal
  from typing import Any, Optional
  from unittest.mock import Mock, patch
  import pytest
  from sqlalchemy import types
  from sqlalchemy.dialects.mysql import BIT, DECIMAL, DOUBLE, FLOAT, INTEGER, LONGTEXT, MEDIUMINT, MEDIUMTEXT, TINYINT, TINYTEXT
  from sqlalchemy.engine.url import make_url, URL
  from superset.utils.core import GenericDataType
  from tests.unit_tests.db_engine_specs.utils import assert_column_spec, assert_convert_dttm
  from tests.unit_tests.fixtures.common import dttm
label_desc: Use image node_id 7 for calling a global function with example usage: test_cancel_query_failed(engine_mock) without return types