Unit Tests¶
This describes how unit testing is done in TotalDepth.
TotalDepth uses the following test frameworks:
- pytest - This is a basic minimum.
- pytest-cov - Pytest’s wrapper around Ned Batchelor’s excellent coverage tool.
- pytest-benchmark - For micro benchmarks.
- Airspeed Velocity - For timeline benchmarks.
Basic Testing¶
Simply:
$ pytest tests/
This should take only a few tens of seconds. If you include the slow tests with --runslow
this will take many minutes.
Testing With Test Coverage¶
For complete coverage you need to run the slow tests and with the following command:
$ pytest --cov=TotalDepth --cov-report html --runslow tests