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

This version

0.0.3

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

Uploaded CPython 3.12+Windows x86-64

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

covers-0.0.3-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.3.tar.gz.

File metadata

  • Download URL: covers-0.0.3.tar.gz
  • Upload date:
  • Size: 333.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for covers-0.0.3.tar.gz
Algorithm Hash digest
SHA256 29252ba6f93df4723bad68fa9811308a51a4898908d39d5b529d9792385d653f
MD5 f08407d29515a3fae1174c7ae878a8c3
BLAKE2b-256 3843ce398f23b2864fe790c5cc3f58ddf6b55b0daa320def5faf179f9ca43174

See more details on using hashes here.

File details

Details for the file covers-0.0.3-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: covers-0.0.3-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for covers-0.0.3-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 85dd7c9de7c01e4864c0d8055efca361960bd14273e6e9305b752c8fd557d4ce
MD5 6e5b1f788b6752447413bf75b29a671a
BLAKE2b-256 5bf2b065f05ac971db608ee6cd674ed41a563d855d7f7b1594e9f770204dfa8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b9356fa24bcca8154135d78398eb0776016e0e7887514a6bd52927288f0f3504
MD5 0fa2627c40f5fbd66d84a5f3f024e908
BLAKE2b-256 6aedb87d82ef9addd5d9f3ce3310c5d8e2ed4ced2df001785c3077694ec8840e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d8a2909e13f8b1538738cdbfb39a7298c7ec63c005822d4bf2d67e223557e7b1
MD5 c0b9452ea84fee89f9b28a4e86554a84
BLAKE2b-256 ec57fd1f518ab05745d7865af6f4f4acc9d77f526e1ae8035d3b79f2c10bd723

See more details on using hashes here.

File details

Details for the file covers-0.0.3-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for covers-0.0.3-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3a075ca5b2f83f040e9cb0ec0e4286e02933206832ebbd110938c6f1fef584f1
MD5 926acc2f1549e660196905d63530b7a9
BLAKE2b-256 d36e327f99767182a9481ba5c024ec9b6a488025de02587fcc4809682e36e178

See more details on using hashes here.

File details

Details for the file covers-0.0.3-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for covers-0.0.3-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 42dcf9aee8e881b32c35131e0ba94ed43e34172a6b6c4fe8c952d67791dccc13
MD5 430742906d24f53a69357b2e4c6189af
BLAKE2b-256 fd1ef978a167b33f663aa053497b1312af0f4d4b72f0cd1fafedd6ce84cd4387

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