Complete guide for writing comprehensive tests for FastAPI backend applications using pytest, pytest-asyncio, and FastAPI TestClient. Emphasizes async testing, proper mocking, layered testing (repository → service → router), and achieving high test coverage.
| Understand test structure | testing-architecture.md | | Write unit tests | unit-testing.md | | Write integration tests | integration-testing.md | | Test async code | async-testing.md | | Use mocks and fixtures | mocking-fixtures.md | | Improve coverage | coverage-best-practices.md | | Test FastAPI routes | fastapi-testing.md |
Skill Status: Modular structure with progressive loading for optimal context management
Комплексное руководство по тестированию pytest для бэкэндов FastAPI. Охватывает модульное тестирование, интеграционное тестирование, асинхронные шаблоны, макетирование, приспособления, покрытие и тестирование, специфичное для FastAPI, с помощью TestClient. Используйте при написании или обновлении тестового кода для серверных служб, репозиториев или маршрутов API. Источник: chacha95/advanced-harness.