Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
itssimon committed Sep 6, 2023
1 parent 1e27f03 commit 99c2b0b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down

0 comments on commit 99c2b0b

Please sign in to comment.