Coveralls Python

2.9.3 · active · verified Fri Apr 17

python-coveralls is a Python interface to the coveralls.io API, enabling continuous integration services to send test coverage reports for Python projects. It integrates with `coverage.py` to process coverage data and send it to Coveralls.io. The current version is 2.9.3, and releases are generally made to address `coverage.py` compatibility, Python version support, or minor bug fixes, rather than on a fixed cadence.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates the typical workflow: first, generate coverage data using `coverage.py` after running your tests, and then use the `coveralls` command-line tool to send the `.coverage` report to Coveralls.io. Ensure the `COVERALLS_REPO_TOKEN` is set, especially in CI environments.

# 1. Install necessary packages
pip install coverage python-coveralls

# 2. Run your tests with coverage.py to generate .coverage data
#    Replace 'pytest' with your actual test runner (e.g., 'python -m unittest discover')
#    Replace 'your_module_name' with the actual name of your package/module to cover
coverage run --source=your_module_name -m pytest

# 3. Send the coverage report to Coveralls.io
#    Set your repository token as an environment variable.
#    In CI environments (e.g., GitHub Actions, Travis CI), this is often handled automatically
#    or provided securely. For local testing, ensure it's exported in your shell.
#    Using a placeholder; replace with your actual token.
export COVERALLS_REPO_TOKEN='YOUR_ACTUAL_COVERALLS_REPO_TOKEN'

#    Now run the coveralls command-line tool
coveralls

view raw JSON →