Run from the project root:
pytest test/ -v| File | Scope | What it covers |
|---|---|---|
conftest.py |
All | Puts code/api on sys.path so other test files can import API modules |
test_score_logic.py |
Unit | Scoring helpers from 05_gold_health_score.ipynb -- min-max scaling, weight sums, overall score, tier boundaries |
test_api_models.py |
Unit | Pydantic models from code/api/models.py -- required/optional fields, type coercion, JSON round-trip |
test_api_endpoints.py |
Integration | All 6 FastAPI endpoints with Databricks stubbed out and mock DataFrames |
test_log_schema.py |
Integration | Checks the JSONL log files have the right fields and reasonable values |
pytest>=8.0.0
httpx>=0.27.0 # needed by FastAPI TestClient
Both are in requirements.txt.