py-testing
Skill0 starsChanged 2 months agoMITView on GitHub
Guides agents through authoring, isolating, and debugging Python tests using Pytest, fixtures, and mocks.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- AllThingsSmitty/proven-skillstheir own version, first seen Oct 6, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- AllThingsSmitty/proven-skills★ 1same 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 repository49 other files it gives its agents.
- bug-reproducerSkill
- claim-checkerSkill
- command-failure-diagnoserSkill
- config-risk-reviewerSkill
- csv-validatorSkill
- deployment-checklist-makerSkill
- diff-reviewerSkill
- factual-summarizerSkill
- field-extractorSkill
- api-contract-testerSkill
- database-migration-helperSkill
- security-vulnerability-fixerSkill
- git-commit-stagerSkill
- git-conflict-resolverSkill
- github-actions-debuggerSkill
- github-issue-triagerSkill
- github-pr-creatorSkill
- github-pr-reviewerSkill
- go-code-qualitySkill
- go-lint-and-vetSkill
- go-testingSkill
- json-schema-converterSkill
- lint-and-typecheckSkill
- meaning-preserving-editorSkill
- meeting-notes-to-actionsSkill
- minimal-bug-fixSkill
- option-comparatorSkill
- py-code-qualitySkill
- py-lint-and-typecheckSkill
- readme-writerSkill
- regression-test-writerSkill
- release-notes-drafterSkill
- repo-inspectorSkill
- research-briefSkill
- reversible-cleanup-plannerSkill
- rust-clippy-checkSkill
- rust-code-qualitySkill
- rust-testingSkill
- small-refactorSkill
- status-updateSkill
- step-by-step-tutorialSkill
- step-decomposerSkill
- tabular-analyzerSkill
- task-briefSkill
- test-runner-debuggerSkill
- ts-code-qualitySkill
- ts-lint-and-typecheckSkill
- ts-testingSkill
- skill-templateSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 6 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Run and debug Python automated tests.
- Distinctive: line 14
Use this skill when:
- Very specific: line 20
Do not use for TypeScript tests.
- Very specific: line 21
Do not use for linting; use py-lint-and-typecheck.
- Very specific: line 28
If test_path is missing: run pytest in current directory or search tests/ directory.
- Very specific: line 29
Never modify assert actual == expected values to force a broken test to pass.
- Distinctive: line 32
Follow these numbered actions:
- Distinctive: line 36
Read failure message and line numbers.
- Very specific: line 42
Run pytest to confirm zero regressions.
- Very specific: line 45
If test fails due to missing module: verify virtualenv or pip install -e .
- Very specific: line 46
If test outputs stdout needed for debugging: add -s flag (pytest -s ...).
- Distinctive: line 76
Stop and ask the user when:
- Distinctive: line 77
Test requires cloud services or proprietary database credentials.
≈ “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
Python Testing (Pytest)
Guides agents through executing, isolating, and debugging Python tests with pytest. Enforces clean fixture usage (conftest.py), parametrization, and mocking.
1. Purpose
Run and debug Python automated tests. A "Pytest Fixture" provides reproducible test dependencies. A "Parametrized Test" runs one test over multiple input/output pairs.
2. When to Use
Use this skill when:
- Running Python test suites with
pytest. - Filtering test runs by keyword (
pytest -k "test_pattern"). - Writing fixtures or mocking external APIs with
unittest.mock.
3. When Not to Use
- Do not use for TypeScript tests; use
ts-testing. - Do not use for linting; use
py-lint-and-typecheck.
4. Required Inputs
test_path: Path to test file or directory (e.g.tests/test_orders.py).keyword_filter: Optional test function name or substring (-k).
5. Missing-Input Behavior
- If
test_pathis missing: runpytestin current directory or searchtests/directory. - Never modify
assert actual == expectedvalues to force a broken test to pass.
6. Procedure
Follow these numbered actions:
- Action 1: Run Targeted Test
- Execute:
pytest <test_path> -k "<keyword>" -v
- Execute:
- Action 2: Inspect Failures & Tracebacks
- Read failure message and line numbers.
- Action 3: Trace Root Cause to Implementation
- Inspect the code file being tested.
- Action 4: Apply Fix & Re-run
- Confirm targeted test passes.
- Action 5: Run Full Test Suite
- Run
pytestto confirm zero regressions.
- Run
7. Decision Rules
- If test fails due to missing module: verify virtualenv or
pip install -e .installation. - If test outputs stdout needed for debugging: add
-sflag (pytest -s ...).
8. Output Format
Emit the report using this template:
### Pytest Execution Report: [Test File]
- **Command**: `pytest [path] -k "[filter]" -v`
- **Status**: [PASSED | FAILED]
- **Duration**: [e.g. 0.08s]
#### Summary
- Tests Run: [Count] | Passed: [Count] | Failed: [Count]
#### Resolution
- [Root cause and fix description]9. Verification Checklist
- Targeted pytest command executed with clean exit code 0.
- No test assertions corrupted.
- Full suite passes without regression.
10. Common Failures and Recovery
| Failure Symptom | Cause | Recovery Action |
Fixture 'db' not found | Missing conftest fixture | Inspect conftest.py location and imports. |
| Test changes shared state | Dirty fixture tear-down | Use yield fixture with cleanup code after yield. |
11. Stop or Escalation Conditions
Stop and ask the user when:
- Test requires cloud services or proprietary database credentials.
12. Examples
Example 1: Successful Execution
Input:
File: tests/test_calc.py
Filter: test_divideOutput:
### Pytest Execution Report: tests/test_calc.py
- **Command**: `pytest tests/test_calc.py -k "test_divide" -v`
- **Status**: PASSED
- **Duration**: 0.04s
#### Summary
- Tests Run: 2 | Passed: 2 | Failed: 0
#### Resolution
- Fixed ZeroDivisionError by adding check in `calc.py`.Example 2: Ambiguous or Missing Input
Input:
Run python tests.Output:
### Pytest Execution Report: Halted - Ambiguous Target
- **Status**: Halted
Please specify the test file or function name you want to run.Example 3: Expected Final Output
Output:
### Pytest Execution Report: tests/test_api.py
- **Command**: `pytest tests/test_api.py -v`
- **Status**: PASSED
- **Duration**: 0.22s
#### Summary
- Tests Run: 6 | Passed: 6 | Failed: 0Does 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.

