Spaces:
Sleeping
Sleeping
Tests Directory
Pytest-based test suite for API routers, schemas, utility modules, feature engineering, model-registry helpers, and lightweight model wrappers.
Running tests
Run full suite:
python -m pytest -q
Run a specific module:
python -m pytest -q tests/routers/test_visualize_router.py
Run by feature folder:
python -m pytest -q tests/data
python -m pytest -q tests/routers
python -m pytest -q tests/models
Test layout
tests/api:- schema validation (
api.schemas) api.mainversion/model lifecycle endpoints
- schema validation (
tests/routers:predict,predict_v2,predict_v3simulatevisualize
tests/data:src.data.loadersrc.data.preprocessingsrc.data.features
tests/evaluation:- metrics and recommendations
tests/models:- model registry helpers
- ensemble/classical model wrappers
tests/utils:- config paths
- logger
- plotting helpers
Current coverage scope
- API routers:
api.routers.predictapi.routers.predict_v2api.routers.predict_v3api.routers.simulateapi.routers.visualize
- API core helpers in
api.main - Data/feature utilities:
src.data.loadersrc.data.preprocessingsrc.data.features
- Evaluation utilities:
src.evaluation.metricssrc.evaluation.recommendations
- Core config/logger/plotting helpers
- Model registry pure/helper behavior
- Lightweight smoke tests for classical models and ensemble wrappers
Notes
- Tests are designed to be deterministic and fast.
- Heavyweight model loading is monkeypatched/stubbed where possible.
- Matplotlib is forced to a non-GUI backend (
Agg) intests/conftest.pyfor CI/headless safety. - Some tests write temporary or small artifacts under existing project artifact paths.