Skip to main content

better_coverage

better_coverage is a pytest plugin that displays pytest-cov coverage results in Jest/Istanbul's console format with a directory tree structure.

Why?

Using better_coverage lets you see coverage in Jest's familiar table format right in your terminal. The reporter organizes files into a directory tree, shows uncovered line ranges (e.g., 5-12,18), and applies the same color coding as Jest so your Python coverage reports look exactly like your JavaScript ones.

Usage

Add the package to your project:

pip install better-coverage

Then run your tests with coverage:

pytest --cov=your_package --cov-report=xml

The Jest-style coverage table will automatically appear at the end of your test run.

Options

The plugin automatically detects terminal width and formats output accordingly. Coverage data is read from pytest-cov, so use standard pytest-cov options:

pytest --cov=your_package --cov-report=xml --cov-branch

Use --cov-branch to enable branch coverage reporting.

Contributing

Contributions are welcome! If you find a bug or have suggestions for improvement, please open an issue or submit a pull request.

License

Apache License 2.0 © 2025 Mridang Agarwalla

Metadata

Release files for better-coverage 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for better-coverage 1.0.0
File Size Uploaded
better_coverage-1.0.0.tar.gz 14.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for better-coverage 1.0.0
File Interpreter ABI Platform
better_coverage-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.3 kB

Release files / better_coverage-1.0.0.tar.gz

Download URL better_coverage-1.0.0.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
de49ea847a69e743234251a481cd71a7e25ad4b37f67c22ddeb5e516683beeb7
BLAKE2b-256 checksum
How to use checksums
ad425b294246951dc40d78884f0723f568470a90828fd01d8cb76883c1d7d88d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / better_coverage-1.0.0-py3-none-any.whl

Download URL better_coverage-1.0.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
613788374b615f7d2ebda67071d960622666d6b7af20c97fd65791de2e1c2ade
BLAKE2b-256 checksum
How to use checksums
e3133e8c91dfff332874c9072b90d2e8d5eace0e81edc2a11c91dd72bf652215
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page