Skip to content

Testing

Philipp Niedermayer edited this page Aug 31, 2026 · 9 revisions

Testing

Tests are located in the tests directory and are run with pytest.

The Jupyter notebooks in the examples directory serve both as examples and as documentation. CI verifies that the notebooks can be executed without errors and that their output is reproducible.

When adding new functionality, it is good practice to add a usage example to one of the notebooks, or at least add a unit test.

Running the tests

With a full development setup:

uv run pytest

For the same warning configuration as used by CI:

uv run pytest -v -W error::RuntimeWarning

Linting and formatting

The project uses prek to run the repository's pre-commit hooks. Ruff is used for formatting and linting, while Pylint performs additional checks.

Run all hooks on the complete repository:

uv run prek run --all-files

This will automatically apply formatting and other available fixes. Run it before committing changes.

For normal development, the hooks can also be run only on changed/staged files:

uv run prek run

The CI workflow runs the same checks, so running prek locally is the easiest way to catch formatting and linting problems before pushing.

Clone this wiki locally