import pytest from asgi_lifespan import LifespanManager from httpx import AsyncClient, ASGITransport from main import app @pytest.fixture async def client(): async with LifespanManager(app): async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as c: yield c