minimal-patch loop for a failing pytest in a python project
Scanned 9/19/2026
npx -y skills add initxy/noeta --skill fix-python-test --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Fix Python Test?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/initxy-fix-python-test)More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.
---
name: fix-python-test
description: minimal-patch loop for a failing pytest in a python project
priority: 50
---
When a Python test is failing, follow this loop precisely:
1. Run `pytest -q` via `shell_run` and read the tail of the output.
The tail names the failing test + the offending line.
2. Use `grep` to find the function under test in the source tree.
Read just the relevant lines of that file with `read`.
3. Apply the smallest possible patch with `edit` —
`old` MUST match the file exactly once. Prefer changing a single
operator or literal over rewriting a function.
4. Rerun `pytest -q` to confirm the suite is green. If a test
still fails, go back to step 2 — do NOT pile more `edit`
calls on top.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!