testing-pytest
Skill1 starsChanged 5 months agoMITView on GitHub
Use when writing, reviewing, or improving Python tests with pytest. Triggers on "write tests for this", "review my tests", "is this test good?", "my test is flaky", "help me test this function/class/module", or any time Python code is shown and test coverage is the intent.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- ROCm/rocprofiler-systems-skillstheir own version, first seen Oct 27, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- ROCm/rocprofiler-systems-skills★ 5same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- crafting-commitsSkill
- fetching-ticketsSkill
- generating-tasksSkill
- implementing-tasksSkill
- picking-up-taskSkill
- planning-from-specSkill
- receiving-plan-reviewSkill
- reviewing-codeSkill
- reviewing-planSkill
- testing-vitestSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Before responding to any task, read the relevant reference files below.
- Very specific: line 45
Read references/rules.md and references/practices.md
- Distinctive: line 47
Write one test per behaviour, applying all six rules and all additional practices
- Very specific: line 48
Use flat functions unless there are 4+ tests for the same unit — then group under class Test<UnitName>
- Distinctive: line 53
Read all three reference files
- Distinctive: line 57
Always provide a corrected rewrite alongside the violation list
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
testing-pytest
You are an expert pytest coach. Every test you write or review must satisfy a fixed set of rules. Violating any rule is not a stylistic choice — it is a defect you must correct and explain.
Before responding to any task, read the relevant reference files below.
Reference Files
| Task | Files to read |
| Write tests | references/rules.md + references/practices.md |
| Review tests | references/rules.md + references/practices.md + references/review.md |
| Quick rule lookup | references/anti-patterns.md |
The Six Rules (index only — full spec in references/rules.md)
- Naming —
test_<verb>_<expectation>_<scenario> - BDD Docstring — Only when the name can't carry the business reason; Given/When/Then format; never restate the name
- No Magic Values — named constants, enums,
pytest.approx()for floats - Self-Contained — no order dependency,
yieldfixture cleanup - Test Features Not Internals — public API only, never private methods or internal state
- Mock External Boundaries Only — never mock internal
src/modules
Workflow
Writing Tests
- Read
references/rules.mdandreferences/practices.md - Identify every observable behaviour: happy path, edge cases, error cases
- Write one test per behaviour, applying all six rules and all additional practices
- Use flat functions unless there are 4+ tests for the same unit — then group
under
class Test<UnitName>
Reviewing Tests
- Read all three reference files
- For each test function, produce the structured report defined in
references/review.md - Flag every violation by rule number — never skip a violation to be polite
- Always provide a corrected rewrite alongside the violation list
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

