Skip to content

Code Testing and Continuous Integration with Pytest

Sebastiano Ferraris edited this page Nov 25, 2019 · 4 revisions

Unit testing with pytest:

  • Install pytest with pip install -r requirements-dev.txt
  • Type pytest in a terminal at the cloned repository.
  • Tests are based on the open dataset in the folder test_data.
  • Bruker2nifti_qa provides more Bruker raw data for further experiments (thanks to Mikaël Naveau).
  • To get the coverage, please run:
pip install pytest-cov
pip install coverage
pip install coverage-badge

Followed by:

pytest --cov --cov-report html
xdg-open htmlcov/index.html  # optional to open the coverage report - simply `open` on mac
coverage-badge -f -o coverage.svg  # optional to update the coverage badge