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

Uploaded CPython 3.12+Windows x86-64

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

covers-0.0.5.dev202604020111-cp312-abi3-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

covers-0.0.5.dev202604020111-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file covers-0.0.5.dev202604020111.tar.gz.

File metadata

File hashes

Hashes for covers-0.0.5.dev202604020111.tar.gz
Algorithm Hash digest
SHA256 edd7c9f0d7e397bad7c2ad9554317dea2e76a432c92d550ce205e5ef16658828
MD5 71a1329cb046edb4c8332d02aaf95c3e
BLAKE2b-256 59124bd8b9734557ff9db94b1da2ccd90891eaab9be54dbdfc27b9a83e352f3a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202604020111-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ab73c81636b304ba76755ebbba858e9c83b8fb0d4167699b2ed6716c34e3ff75
MD5 042b4cf7bc5334057928fa5a01683afa
BLAKE2b-256 16d77c15bc2b098a11d5bc873750bcf6e4cd4ec1e17465a1b68eedfbaf6e683d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202604020111-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 265fcd9cd526dca457ef0af5c4469ff6d564b94339965b4881e405344b4c0121
MD5 be474b91464bfc1f6a364198a8124b51
BLAKE2b-256 9607c30c537ef18e25c98e34f76f2aaec4072b8ad0f9b020c57f6ba812b21e44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202604020111-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dd0326af518a0df24ad32f0ce543c5e5ff6d70727192d40c846489ceaef97ccf
MD5 ab8697eb513472f0edffddc04e052e6b
BLAKE2b-256 5e04b6d16528b113cddfc9d0a158850fa4d52f68951251e4f775c5d6b4f5d23f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202604020111-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4d46430ef048f46012cb6db9ab97d662fc2955fc0fb4202e7a7ac25847846586
MD5 812eb2e9db1bee579e1b35de23134b9f
BLAKE2b-256 f4baaf61d3cf84fb52e56e3d44ee4d4b06dc43961804ff04c290c88c0acf6aaf

See more details on using hashes here.

File details

Details for the file covers-0.0.5.dev202604020111-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for covers-0.0.5.dev202604020111-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b6459b2e818410b9239700549786d5b5b636a04a5b9c2d15aac25039a2fee4f6
MD5 8ea274fe8ae008422b708f1cc442f650
BLAKE2b-256 cd9b518beb652aa3ca1415b510f37a317ae86a23d64a535bc8d65aa0ff18ff4b

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