All skills
github avatar

/pytest-coverage

@caab1f6 official
by githubgithub/awesome-copilot40k stars
5,040

Run pytest tests with coverage, discover lines missing coverage, and increase coverage to 100%.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/pytest-coverage

This session only. Nothing lands on disk.

SKILL.md

≈28 tokens always: the name and description. ≈246 when used: this file.

The goal is for the tests to cover all lines of code.

Generate a coverage report with:

pytest --cov --cov-report=annotate:cov_annotate

If you are checking for coverage of a specific module, you can specify it like this:

pytest --cov=your_module_name --cov-report=annotate:cov_annotate

You can also specify specific tests to run, for example:

pytest tests/test_your_module.py --cov=your_module_name --cov-report=annotate:cov_annotate

Open the cov_annotate directory to view the annotated source code. There will be one file per source file. If a file has 100% source coverage, it means all lines are covered by tests, so you do not need to open the file.

For each file that has less than 100% test coverage, find the matching file in cov_annotate and review the file.

If a line starts with a ! (exclamation mark), it means that the line is not covered by tests. Add tests to cover the missing lines.

Keep running the tests and improving coverage until all lines are covered.

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is a standard developer tool that provides instructions for running pytest and increasing code coverage. No malicious patterns or security risks were identified.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    1/1 file flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at caab1f6. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 20 hours ago.

Activeupdated 7 months ago

README badge

README badge for github/awesome-copilot/pytest-coverage

Runs pytest with coverage reporting to identify untested lines, then guides adding tests until reaching 100% coverage. Uses pytest-cov to generate annotated source files that mark uncovered lines with exclamation marks, helping developers systematically close coverage gaps.

Generated from the current SKILL.md.

Does this work with pytest plugins like pytest-django or pytest-asyncio?
The skill uses standard pytest with the --cov flag and should work alongside any pytest plugin, but the SKILL.md only documents the basic coverage workflow.
What format does the coverage report use?
The skill generates annotated source files in the cov_annotate directory, where lines not covered by tests are marked with an exclamation mark (!).
Can I measure coverage for specific modules only?
Yes. Use the --cov=your_module_name flag to measure coverage for a specific module instead of the entire codebase.
Does this skill help me write the missing tests?
The skill identifies uncovered lines and guides you to add tests, but you write the test code yourself.

Generated from the current SKILL.md. These answers refresh after source changes.