Testing
gravity-toolkit uses the pytest framework to run tests and verify outputs.
Running the test suite requires a dev installation of the gravity-toolkit package to include all of the optional dependencies.
python -m pip install --editable '.[dev]'
Running the Test Suite
Using the pytest command:
pytest test/
Using pixi:
pixi run test
The test suite is run in verbose mode as a default.
Coverage Reports
Coverage reports can be generated using the pytest-cov plugin (which is installed with the dev installation).
pytest --cov gravity_toolkit --cov-report=term
pixi run test "--cov ../gravity_toolkit --cov-report=term"
Parallelization
As a default, the pytest suite is run in parallel using the pytest-xdist plugin (which is also installed with the dev installation).
To run in series and disable parallelization, set the number of processes to 0:
pytest -n 0
pixi run test "-n 0"
Continuous Integration
We use GitHub Actions continuous integration (CI) services to build and test the project on Linux (ubuntu-latest), Mac (macos-latest) and Windows (windows-latest) Operating Systems.
The configuration files for this service are in the GitHub workflows directory.
The workflows use pixi to install the required dependencies and build the custom environment.
The GitHub Actions jobs include: