A comprehensive tutorial on testing a FastAPI application using pytest, async fixtures, and mocking external services. Covers setting up a separate PostgreSQL test database, implementing the transactional rollback pattern for test isolation, mocking AWS S3 with the Moto library, using FastAPI's dependency override system, and writing async tests with httpx AsyncClient and anyio. Includes practical examples testing CRUD endpoints, authentication flows, authorization (401 vs 403), pagination, file uploads, and security checks like ensuring passwords are never returned in responses.

1h 22m watch time

Sort: