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

@@ -16,11 +16,10 @@
# under the License.
# pylint: disable=unused-argument, import-outside-toplevel, protected-access
from flask.ctx import AppContext
from pytest import raises
def test_odbc_impersonation(app_context: AppContext) -> None:
def test_odbc_impersonation() -> None:
"""
Test ``get_url_for_impersonation`` method when driver == odbc.
@@ -36,7 +35,7 @@ def test_odbc_impersonation(app_context: AppContext) -> None:
assert url.query["DelegationUID"] == username
def test_jdbc_impersonation(app_context: AppContext) -> None:
def test_jdbc_impersonation() -> None:
"""
Test ``get_url_for_impersonation`` method when driver == jdbc.
@@ -52,7 +51,7 @@ def test_jdbc_impersonation(app_context: AppContext) -> None:
assert url.query["impersonation_target"] == username
def test_sadrill_impersonation(app_context: AppContext) -> None:
def test_sadrill_impersonation() -> None:
"""
Test ``get_url_for_impersonation`` method when driver == sadrill.
@@ -68,7 +67,7 @@ def test_sadrill_impersonation(app_context: AppContext) -> None:
assert url.query["impersonation_target"] == username
def test_invalid_impersonation(app_context: AppContext) -> None:
def test_invalid_impersonation() -> None:
"""
Test ``get_url_for_impersonation`` method when driver == foobar.