calculate-coverage

Calculate code coverage percentages and identify uncovered lines and branches.

18|5|Updated Nov 3, 2025
One-click install
npx skills add https://github.com/mvillmow/ProjectOdyssey --skill calculate-coverage
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: calculate-coverage
Source: https://github.com/mvillmow/ProjectOdyssey/tree/main/.claude/skills/tier-2/calculate-coverage
Command: npx skills add https://github.com/mvillmow/ProjectOdyssey --skill calculate-coverage

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires coverage, pytest-cov.

What problem does it solve?

Ensuring comprehensive test coverage and identifying untested code paths is crucial for code quality but often a manual and time-consuming process.

Core Features & Use Cases

  • Coverage Measurement: Measures code coverage percentage (overall and per-module) and identifies uncovered lines and branches.
  • Gap Analysis: Helps pinpoint specific areas in the codebase that lack sufficient testing.
  • Use Case: After running your test suite, use this skill to generate a detailed coverage report, then quickly identify functions or branches that need additional test cases to meet your project's coverage thresholds.

Quick Start

Use the calculate-coverage skill to generate an HTML test coverage report for 'module_name' using pytest.

Frequently Asked Questions about calculate-coverage

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

FAQPage Schema
How do I measure test coverage to identify untested code?

Test coverage measures the percentage of your codebase executed by tests. Use pytest with coverage tools to run your test suite and generate a report showing overall coverage percentage, per-module breakdown, and specific uncovered lines and branches, helping you identify gaps in testing.

Can I use pytest-cov to generate a detailed coverage report?

Yes, pytest-cov integrates coverage measurement directly into pytest. It generates HTML and console reports showing which lines and branches are untested, allowing you to pinpoint exactly where additional test cases are needed.

How do I identify which code paths lack test coverage?

Run your test suite with coverage tracking enabled to generate a coverage report. The report reveals uncovered lines and branches across all modules, making it easy to spot specific functions and code paths that need additional test cases.

What's the best way to meet code coverage thresholds in my project?

Calculate coverage metrics for your codebase, review the gap analysis showing untested areas, then write targeted test cases for uncovered lines and branches. Repeat until you meet your project's coverage threshold requirements.

Does coverage analysis work with existing pytest test suites?

Yes, coverage tools integrate seamlessly with pytest. Run your existing test suite with coverage enabled to measure what your current tests exercise, then use the results to guide development of additional test cases.

Why should I measure code coverage after running tests?

Code coverage reveals which lines and branches your tests actually exercise. Without it, you may have gaps in test coverage that hide bugs. Coverage metrics guide you to write additional tests where they matter most for code quality.