Flash out API test suite

This commit is contained in:
2026-06-20 04:01:24 -04:00
parent 78d738b0ee
commit fc394b8555
19 changed files with 1818 additions and 51 deletions
+25 -2
View File
@@ -181,9 +181,32 @@ docker exec -it ppr_nextgen_db mysql -u ppr_user -p ppr_nextgen
```
### Testing
The backend API tests use pytest, FastAPI's `TestClient`, and an isolated in-memory SQLite database with dependency overrides for database sessions and authenticated users.
See [`backend/tests/README.md`](./backend/tests/README.md) for a module-by-module explanation of what the tests cover and why.
```bash
cd backend
pytest tests/
pytest
```
Or, with the Docker development stack running:
```bash
docker compose exec api pytest
```
To inspect API test coverage:
```bash
cd backend
pytest --cov=app --cov-report=term-missing
```
Or in Docker:
```bash
docker compose exec api pytest --cov=app --cov-report=term-missing
```
## Additional Features
@@ -293,4 +316,4 @@ docker-compose down
To remove volumes (database data):
```bash
docker-compose down -v
```
```