Testing
This page describes the current test posture for the modules present in this repository.
Running Tests
From the project root:
pixi run test
With coverage:
pixi run test-cov
The test configuration is in pytest.ini.
Current Coverage Priorities
The highest-value tests for this repository are:
- Configuration loading with
config_loader.load(). - CLI parsing in
config.cli. - Logger setup behavior in
config.logconf. - Input cleanup and mapping behavior in
processing.cleanupandprocessing.map. - Small synthetic optimization runs through
kinopt.localandkinopt.evol. - Post-fit and KKT diagnostics in
kinopt.fitanalysisandkinopt.optimality.
Unit Test Pattern
Use pytest fixtures such as tmp_path for file-I/O behavior:
from config.logconf import setup_logger
def test_logger_creates_log_dir(tmp_path):
log_dir = str(tmp_path / "logs")
setup_logger(name="test", log_dir=log_dir)
assert (tmp_path / "logs").exists()
Integration Test Pattern
Useful integration tests should use small synthetic CSV files and assert concrete outputs:
- Run
processing.cleanupon a minimal raw fixture. - Run
kinopt.localwith a small input table. - Run
kinopt.fitanalysisorkinopt.optimalityagainst generated result files.