Coverage.py
7.3#3 in test coverage toolsFree planFree planAPILinuxmacOSSelf-hosted
Visit| Fact | Coverage.py | gcovr |
|---|---|---|
| Configuration | Settings can live in .coveragerc, TOML, setup.cfg, tox.ini, or pyproject.toml files. | The user guide includes configuration files, exclusion markers and reproducible timestamp features. |
| Coverage types | It measures statement coverage by default and can also measure branch coverage. | Its branch coverage reports are based on GCC's -fprofile-arcs control-flow graph data. |
| Installation | The documented installation command is `python3 -m pip install coverage`. | gcovr is distributed as a Python package installable with pip, with development versions installable from GitHub. |
| Integrations | Official examples cover pytest, unittest, and nose, and pytest commonly uses the pytest-cov plugin. | Cobertura XML can be used with Jenkins, and gcovr also produces Coveralls and SonarQube formats. |
| License | Coverage.py is licensed under the Apache 2.0 License. | gcovr is available under the BSD 3-Clause License. |
| Purpose | Coverage.py measures which parts of Python programs ran and identifies executable code that did not run, commonly to gauge test effectiveness. | gcovr manages GNU gcov and generates summarized code coverage results. |
| Report formats | Reports can be emitted as text, HTML, XML, LCOV, or JSON. | It generates text, HTML, CSV, JSON, Markdown, Clover, Cobertura, Coveralls, JaCoCo, LCOV and SonarQube reports. |
No prices published.
Coverage.py is for developers measuring how much of their Python code their tests exercise. Its report formats and dynamic contexts can help teams inspect coverage in different ways.
gcovr suits C and C++ developers who use GCC coverage data and need reports for local workflows or CI tools. It may also fit teams that want output in formats such as Cobertura, JaCoCo or SonarQube.