Installation of Coverage

pip install coverage

running on a django project :

Running coverage

coverage run --source='.'  ./manage.py test -v2
coverage html
coverage report

Publishing the results with covveralls.io

On https://coveralls.io/github/foxmask/django-th get the token, then install

pip install python-coveralls

Now the command coveralls is available

As I don't use Travis (but not in pro) and don't have private repo, I don't put the token in a .coveralls.yml at all, so to share the result we use the command line :

COVERALLS_REPO_TOKEN=_the_long_string_of_the_token coveralls
INFO:coveralls:200
INFO:coveralls:{"message":"Job ##1.1","url":"https://coveralls.io/jobs/30251510"}

If you go back to coveralls.io, you will find the job and the result of the coverage

Then add the following to your README.rst (for example)

.. image:: https://coveralls.io/repos/github/foxmask/django-th/badge.svg
    :target: https://coveralls.io/github/foxmask/django-th

End

Ready to go !


Comments

comments powered by Disqus