From c12b4e9cbaf82bb09d8ead4052044702f747b7ac Mon Sep 17 00:00:00 2001 From: John Bodley <4567245+john-bodley@users.noreply.github.com> Date: Tue, 25 Jun 2024 10:19:16 -0700 Subject: [PATCH] chore(tests): Cleanup Celery tests (#29355) --- tests/integration_tests/celery_tests.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/integration_tests/celery_tests.py b/tests/integration_tests/celery_tests.py index 3bd82211e5da4..a6b840201f66c 100644 --- a/tests/integration_tests/celery_tests.py +++ b/tests/integration_tests/celery_tests.py @@ -24,7 +24,6 @@ import unittest.mock as mock from typing import Optional from tests.integration_tests.fixtures.birth_names_dashboard import ( - load_birth_names_dashboard_with_slices, # noqa: F401 load_birth_names_data, # noqa: F401 ) @@ -188,7 +187,7 @@ def test_run_sync_query_dont_exist(test_client, ctas_method): } -@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices", "login_as_admin") +@pytest.mark.usefixtures("load_birth_names_data", "login_as_admin") @pytest.mark.parametrize("ctas_method", [CtasMethod.TABLE, CtasMethod.VIEW]) def test_run_sync_query_cta(test_client, ctas_method): tmp_table_name = f"{TEST_SYNC}_{ctas_method.lower()}" @@ -207,7 +206,7 @@ def test_run_sync_query_cta(test_client, ctas_method): delete_tmp_view_or_table(tmp_table_name, ctas_method) -@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices", "login_as_admin") +@pytest.mark.usefixtures("load_birth_names_data", "login_as_admin") def test_run_sync_query_cta_no_data(test_client): sql_empty_result = "SELECT * FROM birth_names WHERE name='random'" result = run_sql(test_client, sql_empty_result) @@ -218,7 +217,7 @@ def test_run_sync_query_cta_no_data(test_client): assert QueryStatus.SUCCESS == query.status -@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices", "login_as_admin") +@pytest.mark.usefixtures("load_birth_names_data", "login_as_admin") @pytest.mark.parametrize("ctas_method", [CtasMethod.TABLE, CtasMethod.VIEW]) @mock.patch( "superset.sqllab.sqllab_execution_context.get_cta_schema_name", @@ -249,7 +248,7 @@ def test_run_sync_query_cta_config(test_client, ctas_method): delete_tmp_view_or_table(f"{CTAS_SCHEMA_NAME}.{tmp_table_name}", ctas_method) -@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices", "login_as_admin") +@pytest.mark.usefixtures("load_birth_names_data", "login_as_admin") @pytest.mark.parametrize("ctas_method", [CtasMethod.TABLE, CtasMethod.VIEW]) @mock.patch( "superset.sqllab.sqllab_execution_context.get_cta_schema_name", @@ -284,7 +283,7 @@ def test_run_async_query_cta_config(test_client, ctas_method): delete_tmp_view_or_table(f"{CTAS_SCHEMA_NAME}.{tmp_table_name}", ctas_method) -@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices", "login_as_admin") +@pytest.mark.usefixtures("load_birth_names_data", "login_as_admin") @pytest.mark.parametrize("ctas_method", [CtasMethod.TABLE, CtasMethod.VIEW]) def test_run_async_cta_query(test_client, ctas_method): if backend() == "mysql": @@ -315,7 +314,7 @@ def test_run_async_cta_query(test_client, ctas_method): delete_tmp_view_or_table(table_name, ctas_method) -@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices", "login_as_admin") +@pytest.mark.usefixtures("load_birth_names_data", "login_as_admin") @pytest.mark.parametrize("ctas_method", [CtasMethod.TABLE, CtasMethod.VIEW]) def test_run_async_cta_query_with_lower_limit(test_client, ctas_method): if backend() == "mysql": @@ -385,7 +384,7 @@ def test_new_data_serialization(): assert isinstance(data[0], bytes) -@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") +@pytest.mark.usefixtures("load_birth_names_data") def test_default_payload_serialization(): use_new_deserialization = False db_engine_spec = BaseEngineSpec() @@ -418,7 +417,7 @@ def test_default_payload_serialization(): assert isinstance(serialized, str) -@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") +@pytest.mark.usefixtures("load_birth_names_data") def test_msgpack_payload_serialization(): use_new_deserialization = True db_engine_spec = BaseEngineSpec()