Python Code Coverage

Python code coverage can be done with coverage.py, to install:

pip install coverage

To run the coverage for auto discover:

#!/usr/bin/env bash
# Run the unit tests.
coverage run -m unittest discover
# Generate coverage report.
coverage report --omit="*/site-packages/*,tests/*,*__init__*"
# Generate html coverage report.
coverage html --omit="*/site-packages/*,tests/*,*__init__*"
# open htmlcov/index.html

By default, coverage generates report for dependent package as well, so that we ignore */site-packages/*.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.