Unit tests, linting and documentation checks are part of the continuous integration (CI) suite. We use tox to orchestrate the tests and run the tests with different Python versions.
The tox
configuration is included in the pyproject.toml
file.
In CI, the unit tests are run for several versions of Python (at the time of writing, all the supported versions are tested). For the most recent Python version (3.9 at the time of writing), the CI environment provides the optional ROOT dependency, which makes it possible to run the tests for the ~valjean.eponine.tripoli4.depletion
module. For this reason, we pass the PYTHONPATH
environment variable into the test environment.
There are three additional test environments, with specific purposes:
docs
:builds the documentation <building-documentation-dvpers>
, with and without thetests
tag, innitpicky mode <nitpicky-mode>
. It also runsthe linkcheck builder <linkcheck>
to check for broken or redirecting external links.linting
:runs the linters <linting>
.parsing
: runs all the unit tests, plus the specific (slow) parsing tests on the outputs of older TRIPOLI-4 versions.
You can use tox
to run your tests, build the documentation or lint the code from the command line. First, install tox
in your virtual environment
<installation>
:
$ pip install tox
To run the unit tests:
$ tox -e py39 valjean tests # for Python 3.9, for example
You need to specify the Python version on the command line.
Building the documentation:
$ tox -e docs
Linting:
$ tox -e linting valjean tests