Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tests): Cleanup Celery tests #29355

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading