From 99c2b0b6425b4991507f562c4d095fe4babe5769 Mon Sep 17 00:00:00 2001 From: Simon Gurcke Date: Wed, 6 Sep 2023 11:31:46 +1000 Subject: [PATCH] Fix test --- tests/test_fastapi.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_fastapi.py b/tests/test_fastapi.py index 8138ecd..dccfafd 100644 --- a/tests/test_fastapi.py +++ b/tests/test_fastapi.py @@ -28,13 +28,15 @@ ENV = "default" -@pytest.fixture() -def app(mocker: MockerFixture) -> FastAPI: +@pytest.fixture(scope="module") +def app(module_mocker: MockerFixture) -> FastAPI: from fastapi import Depends, FastAPI, Security from apitally.fastapi import APIKeyAuth, ApitallyMiddleware, api_key_auth - mocker.patch("apitally.client.asyncio.ApitallyClient._instance", None) + module_mocker.patch("apitally.client.asyncio.ApitallyClient._instance", None) + module_mocker.patch("apitally.client.asyncio.ApitallyClient.start_sync_loop") + module_mocker.patch("apitally.client.asyncio.ApitallyClient.send_app_info") def identify_consumer(request: Request) -> Optional[str]: if consumer := request.query_params.get("consumer"):