diff --git a/tests/app/test_navigation.py b/tests/app/test_navigation.py index 3f2bec8be..e57b1dd87 100644 --- a/tests/app/test_navigation.py +++ b/tests/app/test_navigation.py @@ -1,5 +1,7 @@ import pytest +from flask import Flask +from app import create_app from app.navigation import ( CaseworkNavigation, HeaderNavigation, @@ -10,12 +12,22 @@ from tests.conftest import ( ORGANISATION_ID, SERVICE_ONE_ID, active_caseworking_user, - app_, normalize_spaces, ) + +def flask_app(): + app = Flask('app') + create_app(app) + + ctx = app.app_context() + ctx.push() + + yield app + + all_endpoints = [ - rule.endpoint for rule in next(app_(None)).url_map.iter_rules() + rule.endpoint for rule in next(flask_app()).url_map.iter_rules() ] navigation_instances = ( diff --git a/tests/conftest.py b/tests/conftest.py index c360b0e48..f1bec5d9a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -37,7 +37,7 @@ class ElementNotFound(Exception): @pytest.fixture(scope='session') -def app_(request): +def app_(): app = Flask('app') create_app(app)