Skip to main content

Pytest reporter displaying pytest-cov coverage in Jest/Istanbul format with directory tree

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

better_coverage-1.0.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

better_coverage-1.0.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file better_coverage-1.0.0.tar.gz.

File metadata

  • Download URL: better_coverage-1.0.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for better_coverage-1.0.0.tar.gz
Algorithm Hash digest
SHA256 de49ea847a69e743234251a481cd71a7e25ad4b37f67c22ddeb5e516683beeb7
MD5 998473168e2300ac202ad8574dcb68b7
BLAKE2b-256 ad425b294246951dc40d78884f0723f568470a90828fd01d8cb76883c1d7d88d

See more details on using hashes here.

File details

Details for the file better_coverage-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for better_coverage-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 613788374b615f7d2ebda67071d960622666d6b7af20c97fd65791de2e1c2ade
MD5 2324bc0769a5a0c1af7dfd3e804b3b39
BLAKE2b-256 e3133e8c91dfff332874c9072b90d2e8d5eace0e81edc2a11c91dd72bf652215

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