Link Search Menu Expand Document

Checking coverage

You will also want to make sure that your tests cover most or all of your code. This project uses the Coverage.py tool for measuring code coverage.

To generate your coverage report locally:

$ coverage run --source=<name-of-code-folder> -m pytest
$ coverage report -m
$ coverage html -d ./coverage_report

Locally generated coverage report files can be found within the coverage_report folder. The index.html will report on results at the module level, whereas the *.html files will report on results at the file level. We are not subversioning any coverage report files.


Contact Joe Robertson (joseph.robertson@nrel.gov) for more information.