diff --git a/tests/notifications_utils/conftest.py b/tests/notifications_utils/conftest.py index 7150b1486..8e82f7553 100644 --- a/tests/notifications_utils/conftest.py +++ b/tests/notifications_utils/conftest.py @@ -9,14 +9,18 @@ class FakeService: id = "1234" +# Automatically mock API health check to prevent real HTTP calls during tests +@pytest.fixture(autouse=True) +def _mock_api_health(mocker): + mocker.patch("app.utils.api_health.is_api_down", return_value=False) + + @pytest.fixture def app(): flask_app = Flask(__name__) ctx = flask_app.app_context() ctx.push() - yield flask_app - ctx.pop() @@ -26,10 +30,8 @@ def celery_app(mocker): app.config["CELERY"] = {"broker_url": "foo"} app.config["NOTIFY_TRACE_ID_HEADER"] = "Ex-Notify-Request-Id" request_helper.init_app(app) - ctx = app.app_context() ctx.push() - yield app ctx.pop()