chore(tests): Remove unnecessary/problematic app contexts (#28159)

This commit is contained in:
John Bodley
2024-04-24 13:46:35 -07:00
committed by GitHub
parent a9075fdb1f
commit bc65c245fe
24 changed files with 880 additions and 980 deletions

View File

@@ -20,6 +20,7 @@ from __future__ import annotations
import json
import pytest
from flask.ctx import AppContext
from superset import db, security_manager
from superset.commands.database.exceptions import (
@@ -84,16 +85,14 @@ def get_upload_db():
return db.session.query(Database).filter_by(database_name=CSV_UPLOAD_DATABASE).one()
@pytest.fixture(scope="function")
def setup_csv_upload_with_context():
with app.app_context():
yield from _setup_csv_upload()
@pytest.fixture()
def setup_csv_upload_with_context(app_context: AppContext):
yield from _setup_csv_upload()
@pytest.fixture(scope="function")
def setup_csv_upload_with_context_schema():
with app.app_context():
yield from _setup_csv_upload(["public"])
@pytest.fixture()
def setup_csv_upload_with_context_schema(app_context: AppContext):
yield from _setup_csv_upload(["public"])
@pytest.mark.usefixtures("setup_csv_upload_with_context")