poetry run pytest --cov=app --cov-report=htmltests/api/– endpoint teststests/core/– config, database, cache, metricstests/crud/– database CRUDtests/models/– ORM modelstests/schemas/– Pydantic schemastests/integration/– multi‑step flowstests/unit/– isolated unit teststests/admin/– HTMX admin dashboardtests/architecture/– search, audit, feature flagstests/events/– event bus (Redis/Kafka)tests/gql/– GraphQLtests/cli/– Typer CLItests/tenant/– multi‑tenancytests/middleware/– custom middlewares
Minimum threshold: 85%.
Run poetry run pytest --cov=app to see the report.
An HTML report is generated in htmlcov/.
OpenAPI schema changes are caught by a snapshot test (tests/contract/test_openapi_snapshot.py).
If you intentionally change the API, update the snapshot with:
poetry run pytest --snapshot-updateMutmut runs weekly in CI and can be triggered manually.
It mutates source code and checks if tests still pass.
Run locally with:
poetry run mutmut run --paths-to-mutate app/- Use
pytestfixtures for reusable setup (database sessions, clients). - Mock external services (Redis, S3, Celery) when testing business logic.
- Keep unit tests fast and without I/O.
- Add snapshot tests for stable API contracts.
Tests run on every push via GitHub Actions (Python 3.12 & 3.13).
Coverage must stay at or above 85%.
Mutation testing runs every Sunday to validate test quality.