tests/ — agent guideThe test directory mirrors src/active_inference/ one-for-one. Every
new module under src/ must get a matching test file under tests/. New
chapter scripts must be registered in tests/chapters/test_smoke.py; new
extras topics must be registered in tests/extras/test_smoke.py; application
demos are discovered automatically under tests/demo/test_demo_smoke.py.
src/active_inference/<sub>/<module>.py ↔ tests/<sub>/test_<module>.py
Examples:
| Source file | Test file |
|---|---|
src/active_inference/core/distributions.py |
tests/core/test_distributions.py (+ test_distributions_mvn.py for the multivariate split) |
src/active_inference/estimators/em.py |
tests/estimators/test_em.py |
src/active_inference/utils/grids.py |
tests/utils/test_grids.py |
src/active_inference/visualizations/plotting.py |
tests/visualizations/test_plotting.py |
tests/<sub>/test_<module>.py.tests/chapters/test_smoke.py.class TestGaussian: ....test_pdf_integrates_to_one, not
test_1.numpy / matplotlib calls are fast and catch real bugs.print() inside tests — let pytest capture output._close_figures autouse
fixture pattern in tests/visualizations/.# fast inner loop — skip subprocess smoke tests
pytest tests/core tests/estimators tests/utils tests/visualizations -q
# full suite incl. chapter smoke tests
pytest
# extras smoke tests
pytest tests/extras -v
# application demo smoke + workflow tests
pytest tests/demo tests/test_demo_workflows -v
# coverage
pytest --cov=active_inference --cov-report=term-missing
src/active_inference/.output/.