Related: Travis-CI examples
At the bottom of most of my
.travis.yml are code coverage tests using
The one-time setup is very similar to Travis-CI:
- Create a free coveralls.io account–using your Github credentials.
- add a repository to Coveralls
pytest-cov module is excellent for recursively testing coverage.
You do NOT need
.coveragerc, instead configure with
setup.cfg, with content like:
[coverage:run] cover_pylib = false omit = /home/travis/virtualenv/* */site-packages/* */bin/* [coverage:report] exclude_lines = pragma: no cover def __repr__ RuntimeError NotImplementedError FileNotFoundError ImportError
Coverage on own computer
To help debug coverage issues, simply do the coverage test on your own computer, from Terminal:
pytest --cov --cov-report html firefox htmlcov/index.html
and then you can browse a color-highlighted version of each of your files, showing which lines were excluded, covered or not covered.