Index of every page on this site: llms.txt
All skills
github avatar

/pytest-coverage

@f10fdb8 official
by githubgithub/awesome-copilot41k stars
5,399
Run it yourself

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

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

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

Description uses 1.4% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈113 characters, or 1.4%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo5 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    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.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • Runlayer8mo

    1/1 file flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

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

Last checked against GitHub yesterday.

Activeupdated 9 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.