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.3.dev202511091645.tar.gz (333.2 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.3.dev202511091645-cp312-abi3-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.12+Windows x86-64

covers-0.0.3.dev202511091645-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

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

covers-0.0.3.dev202511091645-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

covers-0.0.3.dev202511091645-cp312-abi3-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

covers-0.0.3.dev202511091645-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.3.dev202511091645.tar.gz.

File metadata

File hashes

Hashes for covers-0.0.3.dev202511091645.tar.gz
Algorithm Hash digest
SHA256 f8a9c385f6dcee7cee6467085af0129bd97ea87fc1ab8dacdee98adfbb04d348
MD5 8e279d95c4b9fa51633abd9c3586dfe8
BLAKE2b-256 8e3266e1c4277ffe01a40e167098ddf0d0df183118e4bdb4b5b13bf2c2e5b66c

See more details on using hashes here.

File details

Details for the file covers-0.0.3.dev202511091645-cp312-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for covers-0.0.3.dev202511091645-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 86a81529845d6902d3b6d262f02e48796d0748b960e448b19bedd66cb5e39cf4
MD5 952500beccf62c697594d2e859bed107
BLAKE2b-256 eaf4096928645217037950a4d4eeb7c1fc81c2d559b8746ee6c33d49fa099c2c

See more details on using hashes here.

File details

Details for the file covers-0.0.3.dev202511091645-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for covers-0.0.3.dev202511091645-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8d398e82b675920cf6dbaf4f0e6a98671a1a560f326b05b1217baae7fc4c63e1
MD5 ce62ed60644b7af87465028c5450d2b4
BLAKE2b-256 1be48c51f1a35fbd34d1890be18a0b5cc350fde1c86669bcac3a911ab878e84b

See more details on using hashes here.

File details

Details for the file covers-0.0.3.dev202511091645-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for covers-0.0.3.dev202511091645-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0224ac8476917f450bf488994735035d70b1c58695c9856ac9b3ee77b44766bd
MD5 14bc805e52104c03bd04bbcc5bd245a6
BLAKE2b-256 8d01a234e1b89f41faa2df2526ddc0fe12dc47b952ac3e513d8e62ed50b2354d

See more details on using hashes here.

File details

Details for the file covers-0.0.3.dev202511091645-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for covers-0.0.3.dev202511091645-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e2066b5860c2ade0b022ba8c4497716c28a6cdabdd95b96c68509731717e816
MD5 e7f251df9b44f989dbee1bd706d9cace
BLAKE2b-256 c431ad7db54ebbc4ac92df732e12ebd28d2e8040d28f1bcc4065e64301bc5ee1

See more details on using hashes here.

File details

Details for the file covers-0.0.3.dev202511091645-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for covers-0.0.3.dev202511091645-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 766c07e067e5255e472703adfa9dce37a8350293059d6860428f2309d1e521c6
MD5 a08630ae05afff613e2f85f945c4dd36
BLAKE2b-256 1b2f70dbddcd5badff0d638b5d59cb44596998ceaa27d037ed48cf87b20ac1cf

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