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.5.dev202511092331.tar.gz (333.4 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.5.dev202511092331-cp312-abi3-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12+Windows x86-64

covers-0.0.5.dev202511092331-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.5.dev202511092331-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.5.dev202511092331-cp312-abi3-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

covers-0.0.5.dev202511092331-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.5.dev202511092331.tar.gz.

File metadata

File hashes

Hashes for covers-0.0.5.dev202511092331.tar.gz
Algorithm Hash digest
SHA256 d8e619f6dd934985dba44dce456c793265193b15ccd4865e2abe1add90497b56
MD5 866d0634e6a1e21be59abd47f1bd3b2a
BLAKE2b-256 2fc35d6157eba16e6d7aaa00a35d7eb60dc6dd6fcf8536ce5cffb878bcc90e56

See more details on using hashes here.

File details

Details for the file covers-0.0.5.dev202511092331-cp312-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for covers-0.0.5.dev202511092331-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0dc9c2fda5225ba6daba6df7e70f5d750ecbe0bb335b31875ddd89f6add09403
MD5 d89b3b9784d30a5aa135288dfb9351e9
BLAKE2b-256 e2596ad6065f9a25f7cbf7e6c8c75fae756c73590d1a8d9b5b6f1a2c4e7a8783

See more details on using hashes here.

File details

Details for the file covers-0.0.5.dev202511092331-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for covers-0.0.5.dev202511092331-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 703c939c43aca469ea36fb9957d341bc727c90995de1e7d7bc649e410f279655
MD5 9e88e1f8966fbc399404e6b5267ed116
BLAKE2b-256 d0adf408413d4c314f63f7f4c7525c615fc610ffac7b52a3c1767c2628d22cd9

See more details on using hashes here.

File details

Details for the file covers-0.0.5.dev202511092331-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for covers-0.0.5.dev202511092331-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ee7d6ccc3820fed535f3f89d8751b6ff8e5140f0cefe963f26d23d2a026dcdaa
MD5 7ecc9281b3863d80385034ebc2889f2c
BLAKE2b-256 49ca5eaebf24fc543fccef8c3efb37e2c01cc00b59b0dc1a520cbdbaa690dc29

See more details on using hashes here.

File details

Details for the file covers-0.0.5.dev202511092331-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for covers-0.0.5.dev202511092331-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 82bd1b645f1915df33bc46c1e98eb55969259e8ffe7e3f55fa90de420ca84a7e
MD5 776e1a433032befc214dad784ad93191
BLAKE2b-256 58aeb09665b65153cb13d40bb2d905180fd5350a62548bb696055e81ff6b757c

See more details on using hashes here.

File details

Details for the file covers-0.0.5.dev202511092331-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for covers-0.0.5.dev202511092331-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8f93057a2bec7b64e661608d6e49429ed898919072c37fe3e579aa29958a540f
MD5 c3e8f634d26879078957cab55a71fc85
BLAKE2b-256 7692b6df355b021cef2fbb5d5e68a1c5e3b5f677a49be0b5a6e7aab208ee38d0

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