Code Testing

We use the pytest package to test our code.

To run the tests, simply run pytest in the root directory of the project.

pytest

This will automatically run all tests in the tests/ directory and additionally creates an code coverage report displayed at the end of the test run.

We configured a few plugins for pytest:

To run pytest in watch mode, use the following command:

pytest-watch -n

Hint

-n deactivates an annoying beep sound when tests run is done

If you haven’t installed python on your system, you can use the docker container to run the tests:

docker compose up --build tests

Hint

This will run the tests in watch mode.