Skip to main content

Near Zero-Overhead Python Code Coverage

Project description

Covers: Near Zero-Overhead Python Code Coverage

Covers is a fast Python code coverage tool, originally based on SlipCover. This version has been re-written as a Rust / PyO3 extension for improved performance and maintainability.

license pypi pyversions tests

About Covers

Covers is a fast code coverage tool. It tracks a Python program as it runs and reports on the parts that executed and those that didn't. That can help guide your testing (showing code that isn't being tested), debugging, fuzzing or to find "dead" code.

Past code coverage tools can make programs significantly slower; it is not uncommon for them to take twice as long to execute. Covers aims to provide the same information with near-zero overhead, often almost as fast as running the original Python program.

How it works

Previous coverage tools like Coverage.py rely on Python's tracing facilities, which add significant overhead. Instead, Covers uses the new sys.monitoring API to collect coverage information with minimal performance impact. The core data collection is implemented in Rust for maximum efficiency.

Getting started

Covers is available from PyPI. You can install it like any other Python module with

pip3 install covers

You could then run your Python script with:

python3 -m covers myscript.py

Using it with a test harness

Covers can also execute a Python module, as in:

python3 -m covers -m pytest -x -v

which starts pytest, passing it any options (-x -v in this example) after the module name. No plug-in is required for pytest.

Platforms

Our GitHub workflows run the automated test suite on Linux, MacOS and Windows, but really it should work anywhere where CPython does.

Contributing

Covers is under active development; contributions are welcome! Please also feel free to create a new issue with any suggestions or issues you may encounter.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

covers-0.0.4.dev202511091711.tar.gz (333.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

covers-0.0.4.dev202511091711-cp312-abi3-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12+Windows x86-64

covers-0.0.4.dev202511091711-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

covers-0.0.4.dev202511091711-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

covers-0.0.4.dev202511091711-cp312-abi3-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

covers-0.0.4.dev202511091711-cp312-abi3-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

Details for the file covers-0.0.4.dev202511091711.tar.gz.

File metadata

File hashes

Hashes for covers-0.0.4.dev202511091711.tar.gz
Algorithm Hash digest
SHA256 8d56179c104fcc2b2d4ee7910d8534772d8b64af40d04bb2bcbc626fd357af81
MD5 ac626b10985db2759f1ecbe3bc828c6e
BLAKE2b-256 a88b6967f0b68b561264d05ef8f377b8782ff0e04c76d9ffb77f4c5a6744fdc5

See more details on using hashes here.

File details

Details for the file covers-0.0.4.dev202511091711-cp312-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for covers-0.0.4.dev202511091711-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 05921144f03da5256f0e08a339ffc7704dab7d95ff3c40fbb827738584c78922
MD5 5d08492b31a1e9e6ef77c9b62ad1b408
BLAKE2b-256 334f6df31768df50e191578fe4cc0bf4f3dbd9b180bc67f0e9eca994aa973b25

See more details on using hashes here.

File details

Details for the file covers-0.0.4.dev202511091711-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for covers-0.0.4.dev202511091711-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5bbfbe2376d3c0a550e427690c9be10f9bf9dfca0fdd78361e6018bf1252b5ee
MD5 ffc0eac5ba48d9f9053f5315adba7eee
BLAKE2b-256 b5c2df47ba52c6d71e5ba81b9249615b368a0fee5914612992df183b9592fcbc

See more details on using hashes here.

File details

Details for the file covers-0.0.4.dev202511091711-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for covers-0.0.4.dev202511091711-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5b8e27c29847326e056aff4e4767b48b6d011920e65018e429c8ed4114106041
MD5 14969f02db6b6e9d70ce6deb65bb2ba1
BLAKE2b-256 071c32625efc93e6f9012a99c0e7db28b895e3ebc6b56c3eb39a1dd9c05ca24e

See more details on using hashes here.

File details

Details for the file covers-0.0.4.dev202511091711-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for covers-0.0.4.dev202511091711-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 afcd35affb439462d26b0507d0924fdf9cae76cb5cf19ff4f06001a39526d11d
MD5 36a50075450adc57cc9fb16fadcb6234
BLAKE2b-256 48a7894b9fed65c323badffb74861ee4ce9a02cb5e625f11597f573fbd3f61ac

See more details on using hashes here.

File details

Details for the file covers-0.0.4.dev202511091711-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for covers-0.0.4.dev202511091711-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e06887a8d505a56e402a1f592fa231b08122a77c7beca436bd3a9237c957223c
MD5 ca40f55b323f13728e30882b1f477398
BLAKE2b-256 86d24d074aa4e649e316dd097c17e9653a96e278f1e5cdd662e41de266d4888d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page