skillfed

coverage-threshold

Tools for coverage threshold limits

coverage-threshold v0.6.2 110.8K downloads/30d#12,440 on PyPI17
Permissive license MIT AGING released

What it is and what it does

coverage-threshold is a command-line tool that enforces code coverage standards by reading JSON reports from Python's coverage tool and comparing them against configurable minimum thresholds. It supports both global coverage minimums (line, branch, or combined) and per-file thresholds, with the ability to override defaults for specific modules or files via TOML configuration.

The tool is designed to integrate into test workflows as a gating step—run your tests with coverage, generate a JSON report, then invoke coverage-threshold to verify the results meet your project's standards. Configuration lives in pyproject.toml by default, allowing thresholds to be version-controlled alongside your code. It has a single runtime dependency (toml) and supports Python 3.7 and later.

Use it for:

  • Enforce minimum line coverage across a codebase in CI pipelines to prevent coverage regressions.
  • Set different per-file thresholds for critical modules while allowing lower coverage in less critical code.
  • Validate that coverage.json reports meet organizational standards before merging pull requests.
  • Configure module-specific coverage rules using path prefixes to handle varying quality requirements across a project.
  • Gate test suite completion on coverage thresholds without requiring external CI/CD platform features.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Validates Python code coverage against configurable minimum thresholds at both global and per-file levels, reading from coverage.json and configuration files.

Yes, if you need to enforce coverage minimums in your test workflow. The tool is straightforward, has minimal dependencies, and integrates cleanly with the standard coverage tool. The aging maintenance status (446 days since last release) is a minor concern for a stable utility, but the repository remains active and the package supports current Python versions. No known vulnerabilities.

Install

coverage-threshold on PyPI

pip

pip install coverage-threshold

uv

uv add coverage-threshold

poetry

poetry add coverage-threshold

Installing coverage-threshold

Before you install

Low install friction with a single lightweight dependency (toml). Repository is aging (446 days since last release) but not archived; last commit was recent. Supports Python 3.7 through 3.13.

License in practice

MIT license is permissive and imposes no restrictions on use, modification, or distribution in proprietary or open-source projects.

Quickstart

pip install coverage-threshold

# After running coverage json:
coverage-threshold --line-coverage-min 95

# Or with config file (pyproject.toml):
coverage-threshold

Requires a coverage.json file generated by the coverage tool; typically run after coverage json in a test workflow.

Verify before relying

  • Whether per-module threshold configuration supports glob patterns or only exact path prefixes as documented.
  • Whether the tool integrates with CI/CD systems or requires manual invocation in pipeline steps.
  • Performance characteristics when validating coverage for large codebases.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 1 — toml
Maintenance aging — 446 days since the last release
Last repo commit
First released
Downloads 110,849/month — #12,440 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: coverage_threshold-0.6.2-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

coverage threshold validationenforce minimum code coveragecoverage report checkercoverage quality gatescode coverage minimumscoverage compliance toolcoverage enforcement
testingcoverage-enforcementci-cd

More Quality Assurance packages