What problem does it solve?
FastAPI integration tests often fail or give misleading results when sync TestClient usage skips lifespan startup, database state leaks across tests, and upstream HTTP calls to vLLM/OpenAI are not properly mocked.
Core Features & Use Cases
- In-process async client with real lifespan: Uses httpx AsyncClient with ASGITransport (lifespan enabled) so startup/shutdown code runs exactly like production.
- Deterministic, isolated DB state: Uses in-memory SQLite with StaticPool plus a per-test create_all/drop_all flow to prevent cross-test contamination.
- Upstream-safe mocking for LLM gateways: Uses respx to mock upstream HTTP calls (e.g., vLLM/OpenAI) and ensures mocks are actually exercised.
- Streaming SSE validation: Verifies streaming outputs at the chunk/byte level using async streaming iteration and SSE markers like [DONE].
Quick Start
Ask to generate a FastAPI pytest integration test setup using httpx ASGITransport with lifespan enabled, an autouse-style DB reset fixture, respx upstream mocking, and SSE chunk assertions for streaming endpoints.