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

Uploaded CPython 3.12+Windows x86-64

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511092351.tar.gz
Algorithm Hash digest
SHA256 71fdb749dfaee9e2761f726dc7e9fc4d1f0321f499aed3c02b99cc664f76d185
MD5 1e3b06076d08239bec65769c805a9932
BLAKE2b-256 e0be022e927ea6de9ccd1b4d1eb60477b51c10e974eab9084b54dfc818b4696f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511092351-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ae19d08c96d5a71cbe0a232dd46efe79c4c4aca6da84a95320e5177b778efe14
MD5 de1a22c1a449258f7c0258a49cc21a07
BLAKE2b-256 ba36b8b19c150d375b3a9077578a46fcade793d5f046b154a2bcf16eeed4c2e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511092351-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ca5d6af5c2aa6a0375354185c10f1944a41bc265742d319ba36513f4f746ce7a
MD5 a611353fd22ae4596d74b441b884a09c
BLAKE2b-256 047f9e39c6cb974da583ac8d40b266d2e098db6fcd3dec2bbbebe5fc5f722ee3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511092351-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 660178a58bb964140a86c144760df3ae20138c3936df20976f73a646494aebd5
MD5 e6a66f525831fab00fc7423b790e7cae
BLAKE2b-256 b25664ddae20339cc222ab25c1a5be4eeaa2ef218202c77d2ab8035e14ea1f2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511092351-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e1cb0b7280fa48480fa94b89eceb76f47036fb827c631df7f9a06631fb2725e4
MD5 058097ce4e5b8ec59f53ea52f2646d99
BLAKE2b-256 4f185ba4caaeb8a76cc344a4b7538e5f8ac427c7a840e2932189063d0b25d9e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511092351-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 649c2b35b4b65f3d1f1450d9357926fc45b08b37390953bdc97245ff0161f038
MD5 679cb5226ad8d6ead740a6714f97edb1
BLAKE2b-256 617663e9e647e47caae853dd09122a07ca55b82ddf03b0c308657cf308662fa9

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