pytest-code-review
Reviews pytest test code for async patterns, fixtures, parametrize, and mocking. Use when reviewing test_*.py files, checking async test functions, fixture usage, or mock patterns.
How do I install this agent skill?
npx skills add https://github.com/existential-birds/beagle --skill pytest-code-reviewIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides comprehensive documentation and checklists for reviewing Python test code using the pytest framework. It is entirely informational, consisting of markdown files without any executable scripts, network access, or sensitive data handling. No malicious patterns or security risks were identified.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- Runlayerpass
5 files scanned · No issues
- ZeroLeakspass
Score: 93/100 · 2 sections analyzed
What does this agent skill do?
Pytest Code Review
Quick Reference
| Issue Type | Reference |
|---|---|
| async def test_*, AsyncMock, await patterns | references/async-testing.md |
| conftest.py, factory fixtures, scope, cleanup | references/fixtures.md |
| @pytest.mark.parametrize, DRY patterns | references/parametrize.md |
| AsyncMock tracking, patch patterns, when to mock | references/mocking.md |
Review gates
Work in order. Do not assert pytest-specific problems until each applicable gate passes.
- Scoped files — Pass when: You list every
test_*.pyand anyconftest.pyyou will cite; no findings for files outside that list. - Async vs sync — Pass when: Per scoped file, you note whether it uses
async def test_*/await; if yes, open references/async-testing.md before criticizing async usage. - Fixtures — Pass when: If shared setup matters, you name the
conftest.pypath(s) or state none; for yield fixtures, confirm cleanup exists before claiming resource leaks. - patch / mocks — Pass when: For any
patchor mock critique, you give the import path where the symbol is used (call site), or mark N/A; open references/mocking.md when mocking is central to the review. - Findings — Pass when: Each finding includes a file path and line(s) or test node id, not a generic rule restatement.
Review Checklist
- Test functions are
async def test_*for async code under test - AsyncMock used for async dependencies, not Mock
- All async mocks and coroutines are awaited
- Fixtures in conftest.py for shared setup
- Fixture scope appropriate (function, class, module, session)
- Yield fixtures have proper cleanup in finally block
- @pytest.mark.parametrize for similar test cases
- No duplicated test logic across multiple test functions
- Mocks track calls properly (assert_called_once_with)
- patch() targets correct location (where used, not defined)
- No mocking of internals that should be tested
- Test isolation (no shared mutable state between tests)
When to Load References
- Reviewing async test functions → async-testing.md
- Reviewing fixtures or conftest.py → fixtures.md
- Reviewing similar test cases → parametrize.md
- Reviewing mocks and patches → mocking.md
Review Questions
- Are all async functions tested with async def test_*?
- Are fixtures properly scoped with appropriate cleanup?
- Can similar test cases be parametrized to reduce duplication?
- Are mocks tracking calls and used at the right locations?
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/existential-birds/beagle/pytest-code-review">View pytest-code-review on skillZs</a>