mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
added fixtures
This commit is contained in:
@@ -38,8 +38,12 @@ from tests.integration_tests.fixtures.birth_names_dashboard import (
|
||||
load_birth_names_data,
|
||||
)
|
||||
from tests.integration_tests.test_app import app
|
||||
|
||||
from tests.integration_tests.fixtures.energy_dashboard import (
|
||||
load_energy_table_with_slice,
|
||||
load_energy_table_data,
|
||||
)
|
||||
import pytest
|
||||
from superset.models.slice import Slice
|
||||
|
||||
from superset.charts.data.commands.get_data_command import ChartDataCommand
|
||||
from superset.connectors.sqla.models import TableColumn, SqlaTable
|
||||
@@ -1027,6 +1031,7 @@ def test_data_cache_default_timeout(
|
||||
|
||||
|
||||
def test_chart_cache_timeout(
|
||||
test_client,
|
||||
login_as_admin,
|
||||
physical_query_context,
|
||||
load_energy_table_with_slice: List[Slice],
|
||||
|
||||
@@ -52,15 +52,15 @@ def load_energy_table_data():
|
||||
)
|
||||
yield
|
||||
with app.app_context():
|
||||
engine = get_example_database().get_sqla_engine()
|
||||
engine.execute("DROP TABLE IF EXISTS energy_usage")
|
||||
with get_example_database().get_sqla_engine_with_context() as engine:
|
||||
engine.execute("DROP TABLE IF EXISTS energy_usage")
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def load_energy_table_with_slice(load_energy_table_data):
|
||||
with app.app_context():
|
||||
_create_energy_table()
|
||||
yield
|
||||
slices = _create_energy_table()
|
||||
yield slices
|
||||
_cleanup()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user