diff --git a/tests/conftest.py b/tests/conftest.py index 4016ff0..46bccca 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1 +1,15 @@ -# Env var setup that must run before app.config is imported. +from collections.abc import AsyncIterator + +import httpx +import pytest +from app.config import Settings +from app.main import create_app +from app.store import MonitorStore + + +@pytest.fixture +async def client() -> AsyncIterator[httpx.AsyncClient]: + app = create_app(settings=Settings(), store=MonitorStore()) + transport = httpx.ASGITransport(app=app) + async with httpx.AsyncClient(transport=transport, base_url="http://test") as value: + yield value