Pytest Coverage
Use when measuring pytest coverage, locating untested lines, and prioritizing behavior-focused tests without treating 100% line coverage as proof of correctness.
Install
npx skills add sandbaseai/workbuddy-skill --skill pytest-coveragegit clone --depth 1 https://github.com/sandbaseai/workbuddy-skill.git /tmp/workbuddy-skill
mkdir -p ~/.claude/skills
cp -r /tmp/workbuddy-skill/skills/pytest-coverage ~/.claude/skills/pytest-coveragePersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# pytest 覆盖率分析 用 pytest-cov 生成覆盖率报告,定位未覆盖行、分支和关键行为,再按风险补充测试。覆盖率是取样信号,不是质量终点;优先保护公开契约、错误路径、权限边界、并发和数据转换。 ## 工作流程 1. 先确认 Python 版本、测试命令、包范围、隔离环境、外部依赖和覆盖率基线。 2. 运行 `pytest --cov --cov-report=term-missing`;需要逐文件定位时生成 `--cov-report=annotate:cov_annotate`。 3. 将缺口按业务影响、变化风险和可观察行为排序,不为无意义的 getter 或生成代码盲目追求数字。 4. 为每个重要缺口补充行为、错误、边界、权限或回归测试;测试应可重复且不依赖真实生产服务。 5. 重新运行测试并比较基线、覆盖率、失败分类和新增测试价值,记录无法覆盖的理由。 ## 约束与安全边界 - 默认在临时环境运行;不使用生产凭据、客户数据或不可逆的外部调用。 - 覆盖率报告可能包含源码路径、分支和敏感常量;发布前审查并脱敏。 - 不修改测试来掩盖失败,不把 `# pragma: no cover` 当成默认逃生口;例外要有范围、理由和复核日期。 - 结论必须同时说明测试通过、覆盖率变化、未覆盖风险和未验证外部依赖。
Details
- Skill name
pytest-coverage- Repository
- sandbaseai/workbuddy-skill
- Path
skills/pytest-coverage/SKILL.md- License
- MIT
- Repo updated
- 8 September 2026
FAQ
What does the Pytest Coverage skill do?
Use when measuring pytest coverage, locating untested lines, and prioritizing behavior-focused tests without treating 100% line coverage as proof of correctness.
How do I install the Pytest Coverage skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add sandbaseai/workbuddy-skill --skill pytest-coverage. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Pytest Coverage popular?
It lives in sandbaseai/workbuddy-skill, which has 9 GitHub stars and 3 forks.
Related skills
Access Control Security Best Practices
9sandbaseai/workbuddy-skill
Design, review, implement, and verify least-privilege access controls across users, services, tenants, resources, and administrative workflows.
Accessibility Review
9sandbaseai/workbuddy-skill
Use when reviewing a web interface or interaction for semantic, keyboard, focus, screen-reader, ARIA, and contrast accessibility risks.
Acquire Codebase Knowledge
9sandbaseai/workbuddy-skill
Use when the user asks to map, document, or onboard into an existing codebase and needs evidence-backed architecture, structure, conventions, integrations, testing, and concerns documentation.
Python Testing Patterns
9sandbaseai/workbuddy-skill
Use when writing or restructuring Python tests with pytest, fixtures, mocks, async code, database boundaries, or CI gates; choose the smallest test layer that proves behavior and preserve diagnostic evidence.
Protocol Reverse Engineering
9sandbaseai/workbuddy-skill
Use when analyzing an authorized packet capture, documented test fixture, or proprietary protocol to understand message structure, interoperability, or communication failures without touching unapproved live traffic.
Respec
9sandbaseai/workbuddy-skill
Use when implementation, testing, or review reveals that an existing feature specification must be revised before work can proceed safely.
Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.