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

Uploaded CPython 3.12+Windows x86-64

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511121426.tar.gz
Algorithm Hash digest
SHA256 dc645896848f6f3456329b81ed98458e611c28245258e7d7c752ab0b7381fef2
MD5 c64dfd2a28e7d753c77a54404df0ccbc
BLAKE2b-256 15f1491ecfdcfb40e8fc07a54a2db94ed8560466e72109db22fd5d2f1e472ba9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511121426-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 df17fbfcc84df2f024553fa821e13c330b425b8066d4ac2ea5abf2e8282a0ab3
MD5 98ee3dd8da387fe83cf2ba95f9e93c62
BLAKE2b-256 60e5a5012250962dd36d850f686e86ba10c9658275fdf61b259f7925ebba3b46

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511121426-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cca92ba21c3d20393bb486c60a1390336b37b06e08f461558c6d1c87f4925d09
MD5 c14abfd224dc5bcea9fa0b5e81db6bda
BLAKE2b-256 39a297f17737f26bffbf084b8ca280f2c5d4370ece2ab2cef46881df2fc42ae2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511121426-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a18a57d85d5bc25fdd227fc192f83978104dbaa43171771ac3ef84d58470a9cd
MD5 79b13c65a52df3eb0e8f37c92ad15fd5
BLAKE2b-256 78c48436caf9bfdc21e8512f678f06cf2c0f8ac752c88dafcb8dd3d8d8b87e64

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511121426-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3c4b0bd4bd48cacee8650638e9f9ac976066f87283aa13f8d87c265f77c3d449
MD5 eb1ca6ac3038276ff95945c40caa4d44
BLAKE2b-256 d25ffe97a0104c882c080c208a5f17a28315a5dddaf99c027881029ebc222971

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202511121426-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6dbcc31f97032af76ad0fe641bfbb10db44f13f91ed705339000331ab372990e
MD5 fb1897cc12fa264cc359830318fbb766
BLAKE2b-256 6ab814fb9c92273a25bf89a60364154c2922597f4a4b4b900615bec603131538

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