Skip to main content

Continuous integration in Python, 5: report test coverage using Coveralls

In this series of posts, we've covered:

Today I will show you how to continuously check your test coverage using Coveralls.

Travis runs whatever commands you tell it to run in your .travis.yml file. Normally, that's just installing your program and its requirements, and running your tests. If you wanted instead to launch some nuclear missiles, you could do that. (Assuming you were happy to put the launch keys in a public git repository... =P)

The Coveralls service, once again free for open-source repositories, takes advantage of this: you just need to install an extra piece of software from PyPI, and run it after your tests have passed. Do so by adding the line pip install coveralls to your before_install section, and just the coveralls command to a new after_success section:

``` ; then coveralls; fi


This is the approach taken by the scikit-image project.)

Update: Volume 6: Badge your repo to show off your work


Comments powered by Disqus