Skip to content

Testing

This project provides a few different tests and checks.

In general, we have two files which define all the tests:

To easily run these tests locally, use:

./scripts/test.sh

If you only want to run the pre-commit hooks manually, use:

uv run prek run --all-files

Python Code Tests

Feature tests as well as test coverage:

# run tests
uv run coverage run -m pytest

# serve html coverage report
uv run python -m http.server -d build/htmlcov

Static code checks using ruff:

# linter
uv run ruff check src
uv run ruff check tests
# formatter
uv run ruff format --diff src
uv run ruff format --diff tests

To run automatic static code fixes, use:

# linter
uv run ruff check --fix src
uv run ruff check --fix tests
# formatter
uv run ruff format src
uv run ruff format tests

Static code analysis using pylint:

uv run pylint --fail-under=8 src
uv run pylint --exit-zero tests

Static type checks using ty:

uv run ty check src
uv run ty check tests

General typo checking using typos:

uv run typos

Markdown Checks

Verify documentation (markdown) compliance w.r.t. markdown linting rules further specified inside the .markdownlint-cli2.jsonc configuration file.

npm exec markdownlint-cli2 -- "./docs/**/*.md" "./README.md"

License Checks

uv run licensecheck
uv run reuse lint

Vulnerability Checks

uv audit