Test Fixing Skill for Grouped pytest Failures in Claude Code
Cluster failing tests by root cause, resolve shared collection problems first, and verify focused fixes before rerunning the full suite.
中文Install in Claude Code
Use your own Python project with pytest. Use uv run pytest if the project uses uv, and keep the repository's normal full test entry point.
- Get the complete `cli-tool/components/skills/development/test-fixing` directory from the pinned GitHub commit.
- Copy it into the target project's `.claude/skills/`. Check `.claude/skills/test-fixing/SKILL.md`, start Claude Code at the project root, and call `/test-fixing`.
Example task
After renaming utils.money, run uv run pytest. Repair obsolete imports as one group, then run uv run pytest tests/test_receipts.py -v for the remaining amount assertion and rerun the full suite.What to check
Collection completes, the amount behavior is verified independently, and the full suite confirms the overall change.
Original SKILL.md on GitHub · Updated
Frequently asked question
Can I diagnose an amount assertion when pytest exits during collection?
Resolve the collection blocker first. Run the affected file afterward to expose the real assertion output.