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

Uploaded CPython 3.12+Windows x86-64

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511120152.tar.gz
Algorithm Hash digest
SHA256 cbb3696af0adbeed36f5e615970777c9da13bb4b21f8b31f1b4d6fc7b64c4058
MD5 6bb72ae848ab5038cf89d11fe47a7081
BLAKE2b-256 4a4025a821bd1698cb91fc2978e3b87f7b9a45d9d8eace9ec2b45c0648eaa488

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511120152-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d9d20d915322ba602390ed956edc52dea89053dd522ed9e6b23ce19f5428956e
MD5 dd5e071c57f4dade0ca2192eaee36e04
BLAKE2b-256 17f9bf998783e9a8a128b9d8cae2b6e76f1c497f3f1a9d697137a5b37d3561c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511120152-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 35d4ec9d76b01b44143fd96bdfb6bbfd5743785a32f45419eeebd211d0d8b0b4
MD5 225e73a9792d919011a08e3be0266564
BLAKE2b-256 c1537732d255998148eb6ec2164bd988643f04ed779dcee252a81428951381c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511120152-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 00cb191e76b4eb5ecdaaec7ca5605fd258cafa2af45fa8d1f5a1ab0557bc7d4c
MD5 af4f48607289625e472b8aab4961012e
BLAKE2b-256 b1ac6ea14334c0fa4083e62abebb6b924b04778b8affd1c78c0b20fa934a1531

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511120152-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 864960dc36325529db9163e76bfd5eba6316ffc3b1916d7e00e4e95ad9a0aa00
MD5 466a51406c08623c98b885c560be3276
BLAKE2b-256 8d9676e58a2dc45e8fda0d9c0bb9baac483ebc299f89b058eb3e69aab95fe51f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511120152-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 90464766494ea6a3edd9edb2fda34bdbd0a3c7b632c3175366859b0c0ff80d4d
MD5 8b5a1af77ff5682709f7ee4552480f97
BLAKE2b-256 cefe28837c3ab31521d8e5099fa6e6ac0798d2037a889763921f7d784931e82a

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