Skip to main content

Compare local pytest coverage against a saved baseline.

Project description

cmp-cov

Compare local pytest coverage against a saved baseline.

Usage

# After running pytest --cov, save current coverage as the baseline:
uvx cmp-cov save-baseline

# Later, after another pytest --cov run, diff against the baseline:
uvx cmp-cov diff

Both subcommands take an optional baseline name (default default); each name is a separate slot, so multiple baselines per project coexist:

cmp-cov save-baseline main
cmp-cov save-baseline before-refactor
cmp-cov diff main

save-baseline snapshots the current .coverage (SQLite) and source files into ~/.cache/cmp-coverage/<encoded-project-path>/<name>/. diff regenerates current coverage XML, translates baseline line numbers through the snapshotted sources (so source edits between save and diff are handled), and prints per-line diffs grouped by category. Exit code is non-zero if total coverage dropped or any regression / new uncovered line was found.

Each output location is rendered as path:line so it is clickable in editors that support terminal links (e.g. VSCode).

Output categories

  • ↓ covered → uncovered — lines that were covered in baseline and are not anymore.
  • + new uncovered — lines added since baseline that are not covered.
  • ↓ covered line removed — lines that were covered in baseline and have been deleted from the source. Path points at the cached baseline snapshot.
  • ↑ uncovered → covered — lines that were not covered in baseline and are covered now.
  • + new covered — lines added since baseline that are covered.
  • - removed line — non-covered lines that were removed.
  • ! unmeasured in baseline (uncovered) — lines in files that were not measured by the baseline run, currently not covered.
  • ! unmeasured in baseline (covered) — same, but covered now (compact view).

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

cmp_cov-0.2.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

cmp_cov-0.2.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file cmp_cov-0.2.0.tar.gz.

File metadata

  • Download URL: cmp_cov-0.2.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cmp_cov-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7860bc551aaa68133939103c3cb22eca38043d730fe843466d7c464e6c20626b
MD5 8a6a142c920e31b7cea0ce2138f72244
BLAKE2b-256 6bae0e7216b49230488e18594446d185824d164fba52c50280e31b227aadbeba

See more details on using hashes here.

File details

Details for the file cmp_cov-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cmp_cov-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cmp_cov-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bccf07c1edd50b034d6ec01b368dd01565dc503683faaa37e63011fcd809624
MD5 f2a237dc9351f1e6cd55aa0d5d5b51f2
BLAKE2b-256 9ca5b74def8feaa7d5957632021810f660e00cae8190f60c8b24e49f9989df88

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