Skip to content

Commit

Permalink
chore(tests): Cleanup Celery tests (#29355)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bodley committed Jun 25, 2024
1 parent d69363e commit c12b4e9
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions tests/integration_tests/celery_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down Expand Up @@ -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()}"
Expand All @@ -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)
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit c12b4e9

Please sign in to comment.