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.1.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.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cmp_cov-0.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 313406b9ea9dd93ad53f0a59adc678cc589dff55db1218923965da13e4600ba9
MD5 cf7a180b9f0aa2db02809e2d58fe81ea
BLAKE2b-256 9904795b06ea09c297eed2754b51639ad2e90ef82e63b136c20bab85c2c6f839

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cmp_cov-0.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 485a7128deb8dc8b969fb39c1ad314e0b60223cc2ea022ddc767b772fb54e7d1
MD5 ca7e75b7d84334f510bc2c324d1d2749
BLAKE2b-256 2d3402cb4511965642fb25ccdc737282ed7f75e0e84b862c24bf77f258a3ad5f

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