afp-backend / docs /testing.md
cdupland
Add FastAPI application structure with Prisma integration, including API endpoints, services, repositories, and database setup. Introduce strict layering rules, documentation, and testing strategy.
0ddf928
# Testing strategy
## Test levels
- `tests/unit`: pure business logic, mocks only.
- `tests/integration`: Prisma repositories against local Supabase DB.
- `tests/e2e`: full HTTP flow via FastAPI app.
## Markers
- `@pytest.mark.unit`
- `@pytest.mark.integration`
- `@pytest.mark.e2e`
## Commands
```bash
pytest -m unit
pytest -m integration
pytest -m e2e
pytest -m "not integration"
```
## Fixtures
- `prisma`: shared Prisma connection for tests.
- `app`: FastAPI app with DB dependency override.
- `client`: HTTPX async client bound to ASGI app.