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

Uploaded CPython 3.12+Windows x86-64

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202604140139.tar.gz
Algorithm Hash digest
SHA256 8dba41744ed0285c99e44b3febfeed496743ee8cf24b465f50546f2009ca52d9
MD5 3bdf048afd950c0536424e5e99630390
BLAKE2b-256 db3650bd58a5fd938782c562340a2d24dad750d22acdd916e8ba042666583241

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202604140139-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a90528d94ee08dd08dea287fb43ea218454f41978c7b6e2f1a7f759998ed482e
MD5 90674bc5b7e781da80e982cdbc5d2ba9
BLAKE2b-256 ed6dcf2d9a9e95e2a1ea7ca225e08bb43bba6b904c3070996e4cf087885b930d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202604140139-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fd7e17fd948e1e5d6445c1e4cc3c32b1af68cb87a515dc96134d13817607ac16
MD5 6060085447f2532ae9e60b9f80383b1d
BLAKE2b-256 0a57aeb5fc1ec6a8fd65b2b013ed53400c6069dbafc24ab2b5f4012724e6a996

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202604140139-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5fc6673860e661ac5cafeba1d479b07f96f6b30fb28c33fddf52e624229e8d2c
MD5 221962e560bc471dea3dd96a8f2b2bc8
BLAKE2b-256 f86a78f36b36d6ab215ff2c5ea00e91593b6fdd3e1a3dbfb35acf5c52a6a123f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202604140139-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e14d512e08d6d71f26fdd82486dbf12ca9d4f6019e343e798d9a23fa10cc1160
MD5 954798c2a78ba02a09e11a4e6f504b68
BLAKE2b-256 ebfb03265c34eba3fb3ebe79a1467415756d8a17dd714cc5f2210538a6a6d31b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.5.dev202604140139-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 abb9505903c4e24d2a70812021885317a81d39c9687cdd699469fd42f21b7ab7
MD5 217da9c5aeed88c0a1840e22826f4b3c
BLAKE2b-256 425a6a9217cb2dc9b03f29b2537d092292fa3ca37907564f92ef5eb9d6c88f7f

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