Merge pull request #1046 from dod-ccpo/tests-debug
Enable debug mode in tests.
This commit is contained in:
@@ -27,13 +27,7 @@ dictConfig({"version": 1, "handlers": {"wsgi": {"class": "logging.NullHandler"}}
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def app(request):
|
||||
upload_dir = TemporaryDirectory()
|
||||
|
||||
config = make_config()
|
||||
config.update(
|
||||
{"STORAGE_CONTAINER": upload_dir.name, "CRL_STORAGE_PROVIDER": "LOCAL"}
|
||||
)
|
||||
|
||||
_app = make_app(config)
|
||||
|
||||
ctx = _app.app_context()
|
||||
@@ -41,11 +35,27 @@ def app(request):
|
||||
|
||||
yield _app
|
||||
|
||||
upload_dir.cleanup()
|
||||
ctx.pop()
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def no_debug_app(request):
|
||||
config = make_config(direct_config={"DEBUG": False})
|
||||
_app = make_app(config)
|
||||
|
||||
ctx = _app.app_context()
|
||||
ctx.push()
|
||||
|
||||
yield _app
|
||||
|
||||
ctx.pop()
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def no_debug_client(no_debug_app):
|
||||
yield no_debug_app.test_client()
|
||||
|
||||
|
||||
def apply_migrations():
|
||||
"""Applies all alembic migrations."""
|
||||
alembic_config = os.path.join(os.path.dirname(__file__), "../", "alembic.ini")
|
||||
|
Reference in New Issue
Block a user