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.2

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.2.tar.gz (313.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.2-cp312-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12+Windows x86-64

covers-0.0.2-cp312-abi3-manylinux_2_34_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.34+ x86-64

covers-0.0.2-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

covers-0.0.2-cp312-abi3-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

File details

Details for the file covers-0.0.2.tar.gz.

File metadata

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

File hashes

Hashes for covers-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f504b9176b4fda3bbf7032add472889fa75093b0f3e841a23fd44789a0ada028
MD5 c91b9d147e2511f7bfcaafb9584ff367
BLAKE2b-256 c79861432d36e8263010a81cde68b43452ee8d18a771bfb1d4dd1750caf2ebf5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: covers-0.0.2-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.2 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.2-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 acbada6ba26a67a7aba9f9906e9a59c1e25bdd1915c46c9af9a790e756d14153
MD5 f2a1fafe21335333cd24675545cb880b
BLAKE2b-256 4952a4aaa0d448f17e008899931c5e6c79a172a1f2a7dabe83fe444105d3ab22

See more details on using hashes here.

File details

Details for the file covers-0.0.2-cp312-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for covers-0.0.2-cp312-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0096db20a3faffa27672a14af1973580713a18e4375ac93f6957dae5f8fbd53c
MD5 823b7678ea2fd61b91290b9e0f9a6eff
BLAKE2b-256 a01950cd776fca1a1f015fecf9b12f1332244265ee452f67e15341dff0d1f196

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.2-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d2340fa1182bc21b46f8a690d3d5b43ed78082bab230ebfd6f7d41b859391dae
MD5 5eb158751c4745fd594812e513250e42
BLAKE2b-256 b1b73836acdc0429072862bc99391a0b6890ec7ec7cfcdc7afb66a61b35accd3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covers-0.0.2-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3db4126f88ab64d2ca22245fe10cbcec5dcdb24f9a9e215c0d83323dccf9dd5b
MD5 3ba0c4c178b1b1a629a09d6c37479a81
BLAKE2b-256 622ef617c5e140ce18b682a16cf40d30863f260c542e3852aebd101e5318c4b2

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