test: autouse app_context in unit tests (#20911)

This commit is contained in:
Jesse Yang
2022-08-02 15:42:50 -07:00
committed by GitHub
parent c06d5eb70c
commit 7e836e9b04
37 changed files with 142 additions and 212 deletions

View File

@@ -21,7 +21,7 @@ import copy
from sqlalchemy.orm.session import Session
def test_import_database(app_context: None, session: Session) -> None:
def test_import_database(session: Session) -> None:
"""
Test importing a database.
"""
@@ -48,9 +48,7 @@ def test_import_database(app_context: None, session: Session) -> None:
assert database.external_url is None
def test_import_database_managed_externally(
app_context: None, session: Session
) -> None:
def test_import_database_managed_externally(session: Session) -> None:
"""
Test importing a database that is managed externally.
"""

View File

@@ -21,7 +21,7 @@ from sqlalchemy.orm.session import Session
from superset.databases.utils import make_url_safe
def test_make_url_safe_string(app_context: None, session: Session) -> None:
def test_make_url_safe_string(session: Session) -> None:
"""
Test converting a string to a safe uri
"""
@@ -31,7 +31,7 @@ def test_make_url_safe_string(app_context: None, session: Session) -> None:
assert uri_safe == make_url(uri_string)
def test_make_url_safe_url(app_context: None, session: Session) -> None:
def test_make_url_safe_url(session: Session) -> None:
"""
Test converting a url to a safe uri
"""