mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
Create fixture that just calls create_app
This commit is contained in:
@@ -12,16 +12,20 @@ from app.dao.provider_details_dao import get_provider_details_by_identifier
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def notify_api():
|
||||
def notify_app():
|
||||
app = Flask('test')
|
||||
create_app(app)
|
||||
return app
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def notify_api(notify_app):
|
||||
# deattach server-error error handlers - error_handler_spec looks like:
|
||||
# {'blueprint_name': {
|
||||
# status_code: [error_handlers],
|
||||
# None: { ExceptionClass: error_handler }
|
||||
# }}
|
||||
for error_handlers in app.error_handler_spec.values():
|
||||
for error_handlers in notify_app.error_handler_spec.values():
|
||||
error_handlers.pop(500, None)
|
||||
if None in error_handlers:
|
||||
error_handlers[None] = {
|
||||
@@ -32,10 +36,10 @@ def notify_api():
|
||||
if error_handlers[None] == []:
|
||||
error_handlers.pop(None)
|
||||
|
||||
ctx = app.app_context()
|
||||
ctx = notify_app.app_context()
|
||||
ctx.push()
|
||||
|
||||
yield app
|
||||
yield notify_app
|
||||
|
||||
ctx.pop()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user