pytest-coverage-check

Run pytest with pytest-cov and fail below a minimum coverage threshold.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/arelben/Goals-Dashboard --skill pytest-coverage-check
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytest-coverage-check
Source: https://github.com/arelben/Goals-Dashboard/tree/main/.agent/skills/pytest-coverage-check
Command: npx skills add https://github.com/arelben/Goals-Dashboard --skill pytest-coverage-check

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Runs pytest with coverage monitoring and enforces a minimum coverage percentage (default 85%). Trigger: When user asks to run tests using pytest.

Core Features & Use Cases

  • Enforces minimum coverage threshold using pytest-cov to fail when below the configured baseline.
  • Generates actionable reporting of missing coverage to guide targeted testing.
  • Suitable for local development and CI pipelines to maintain code quality.

Quick Start

Run pytest with coverage enforcement to ensure your project meets the minimum threshold.

Frequently Asked Questions about pytest-coverage-check

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce a minimum pytest coverage threshold in my Python project?

You can enforce pytest coverage by running pytest with pytest-cov and configuring a minimum coverage threshold, which fails the test suite when the baseline is not met. The default threshold is 85%.

How do I report missing test coverage gaps using pytest-cov?

Reporting missing coverage gaps with pytest-cov generates actionable output highlighting untested code paths. This guides targeted test writing to close coverage gaps and satisfy the minimum threshold requirement.

Can I use pytest coverage enforcement in CI pipelines?

Yes, pytest coverage enforcement is suitable for CI pipelines to maintain consistent code quality. It runs pytest with coverage monitoring and fails the pipeline build when the coverage drops below the configured baseline.

What is the default coverage percentage required to pass a pytest coverage check?

The default minimum coverage percentage required to pass a pytest coverage check is 85%. This baseline ensures consistent test coverage across your Python project during development and CI runs.

Why does my pytest test suite fail when code coverage is below the threshold?

Your pytest suite fails because coverage enforcement is active, configured to reject test runs falling below the minimum threshold. This mechanism ensures code quality by blocking merges with insufficient test coverage.