from typing import AsyncIterator import fastapi import httpx import pytest from service.main import app as _app @pytest.fixture def anyio_backend(): return "asyncio" @pytest.fixture def app() -> fastapi.FastAPI: return _app @pytest.fixture async def test_client(app: fastapi.FastAPI) -> AsyncIterator[httpx.AsyncClient]: async with httpx.AsyncClient(app=app, base_url="http://testserver") as client: yield client