Running unit tests
The emulsim package contains several unit tests, typically contained
in sub-module tests in the folder of a given module. These tests ensure
that basic functions work as expected, in particular when code is changed in
future versions. To run all tests, there are a few convenience scripts in the
root directory tests. The most basic script is tests_run.sh,
which uses pytest to run the tests in the sub-modules of the
emulsim package. Clearly, the python package pytest needs to
be installed. There are also additional scripts that for instance run tests in
parallel (need the python package pytest-xdist installed), measure test
coverage (need package pytest-cov installed), and make simple performance
measurements. Moreover, there is a script test_types.sh, which uses
mypy to check the consistency of the python type annotations and there is
a script codestyle.sh, which checks the coding style.
Before committing a change to the code repository, it is good practice to run the tests, check the type annotations, and the coding style with the scripts described above.