Unit Testing and Coverage

Prepare the Environment

Assuming you have forked the repository and cloned it locally.

Use cd JAnim to enter the project folder, then install the environment with test dependencies:

pip install -e .[test]

Run Tests

Run all tests with the following command:

python scripts test-cov

This command runs the test suite with coverage and analyzes code coverage. The analysis result is saved to the .coverage file in the project root directory.

Note

If you only want to run tests without checking coverage, you can use:

python test

Generate a Coverage Report

You can use the --html option to generate a detailed HTML coverage report and automatically open it in the default browser:

python scripts test-cov --html

Note

JAnim’s code coverage is currently still low. If you are interested in improving test coverage, contributions of more test cases are welcome.