Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install coveralls

How to install coveralls

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install coveralls
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.2 Available View build log
Windows (64-bit)
0.2 Available View build log
Mac OS X (10.5+)
0.2 Available View build log
Linux (32-bit)
0.2 Available View build log
Linux (64-bit)
0.2 Available View build log
0.2 Available View build log
 
Author
License
MIT
Imports
Lastest release
version 0.2 on May 27th, 2013
https://travis-ci.org/coagulant/coveralls-python.png?branch=master https://coveralls.io/repos/coagulant/coveralls-python/badge.png?branch=master https://pypip.in/v/coveralls/badge.png https://pypip.in/d/coveralls/badge.png

Coveralls.io is service to publish your coverage stats online with a lot of nice features. This package provides seamless integration with coverage.py in your python projects. For ruby projects, there is an official gem. Only projects hosted on Github are supported.

Works with python 2.6+, 3.2+ and pypy 1.9.

Usage (Travis CI)

This library will publish your coverage results on coveralls.io for everyone to see (unless you're using pro account). This package can possibly work with different CI environments, but it's only tested to work with Travis CI atm.

  1. First, log in via Github and add your repo on Coveralls website.

  2. Add pip install coveralls to install section of .travis.yml

  3. Make sure you run your tests with coverage during the build in script part. Example:

    # --source specifies what packages to cover, you probably want to use that option
    script:
        coverage run --source=yourpackagename setup.py test
    

    Note, that example command will gather coverage for specified package. If you wish to customize what's included in your reports, consult coverage docs.

  1. Execute run coveralls in after_success section:

    after_success:
        coveralls
    

Full example of .travis.yml:

language: python
python:
  - 2.7
  - 3.3
install:
  - pip install -r requirements.txt --use-mirrors
  - pip install coveralls --use-mirrors
script:
  - coverage run --source=moscowdjango,meetup manage.py test
after_success:
  - coveralls
Usage (another CI)

If you're NOT using Travis, you have to provide at least a repo_token option in .coveralls.yml at the root of your repo. This is your own secret token, which is available at the bottom of your repository's page on Coveralls. Make sure it stays secret, do not put it in your public repo.

Example of .coveralls.yml:

# .coveralls.yml
repo_token: TjkDuVpGjuQcRhNW8dots9c8SSnv7ReM5

How it works

It makes custom report for data generated by coverage.py package and sends it to json API of coveralls.io service. All python files in your coverage analysis are posted to this service along with coverage stats, so please make sure you're not ruining your own security! For private projects there is Coveralls Pro.

Tips for coverage.rc config

This section is a list of most common options for coverage.py, which collects all the data. Coveralls feeds from this data, so it's good to know how to to configure it.

To limit the report with only your packages, specify their names (or directores):

[run]
source = coveralls,your_otherpackage

To exclude parts of your source from coverage, for example migrations folders:

[run]
omit = */migrations/*

Some lines are never executed in your tests, but that can be ok. To mark those lines use inline comments right in your source code:

if debug:   # pragma: no cover
  msg = "blah blah"
  log_message(msg, a)

Sometimes it can be tedious to mark them in code, so you can specify whole lines to .coveragerc:

[report]
exclude_lines =
    pragma: no cover
    def __repr__
    raise AssertionError
    raise NotImplementedError
    if __name__ == .__main__.:

Development

Run tests:

$ python setup.py test

Install latest unstable version:

$ pip install coveralls==dev

0.2 (2013-05-26)

  • Python 3.2 and PyPy support
  • Graceful handling of coverage exceptions
  • Fixed UnicodeDecodeError in json encoding
  • Improved readme

0.1.1 (2013-02-13)

System Message: WARNING/2 (<string>, line 148)

Title underline too short.

0.1.1 (2013-02-13)
-----------------
  • Introduced COVERALLS_REPO_TOKEN environment variable as a fallback for Travis
  • Removed repo_token from verbose output for security reasons

0.1 (2013-02-12)

  • Initial release

Subscribe to package updates

Last updated May 27th, 2013

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.