Test Guidelines

Warning

Currently, the code is only partially tested via doctests. However, tests are very important to ensure that the code is working as expected. Without full test suites we cannot leave the alpha state of development.

Writing Tests

Consistency Checks at Runtime

Implement consistency checks in your code that check at runtime whether the input and output of scripts, functions and other objects is sensible.

Unit Tests

Integration Tests

Regression Tests

Performance Tests

Running Tests

Tests are automatically run as GitHub Actions when pushing changes to the upstream repository. However, sometimes it is also useful to run them locally.

Doctests

We use doctest to check whether the code examples given in the documentation work as expected. Sphinx already brings a convenient extension to run doctest on all our example codes. Simply do:

cd path/to/mdtools/docs/
make doctest

Note that you have to install the requirements in docs/requirements-docs.txt to be able to run the above command (see Building the Documentation).

Unit Tests

We plan to use pytest to run unit tests. The tests can then be run via

cd path/to/mdtools/
python3 -m pytest .

Integration Tests

Regression Tests

Performance Tests