pytest-code-review

pytest-code-review is a skill for Claude Code, Codex from existential-birds/beagle. It costs 47 tokens per session (1,046 once invoked), scanned A, original, Apache-2.0.

A checklist for reviewing pytest test code. pytest is a Python testing tool, and the checklist covers asynchronous tests, reusable fixtures, parameterized cases, and mocks.

In plain words
What is it for?
Use it to review test files, conftest.py setup files, async tests, fixtures, parameterized tests, and mock or patch usage.
Why use it?
It helps prevent tests that use setup incorrectly, fail to clean up resources, mishandle asynchronous code, or mock the wrong thing.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to review test files, conftest.py setup files, async tests, fixtures, parameterized tests, and mock or patch usage.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/existential-birds/beagle/pytest-code-review
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add existential-birds/beagle --skill pytest-code-review
Clone the repo
git clone --depth 1 https://github.com/existential-birds/beagle

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pytest-code-review

README.md
[![agentmods](https://agentmods.dev/badge/skills/existential-birds/beagle/pytest-code-review/github.svg)](https://agentmods.dev/skills/existential-birds/beagle/pytest-code-review)
Your own site
<a href="https://agentmods.dev/skills/existential-birds/beagle/pytest-code-review"><img src="https://agentmods.dev/badge/skills/existential-birds/beagle/pytest-code-review/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pytest-code-review

Your own site · 80×15
<a href="https://agentmods.dev/skills/existential-birds/beagle/pytest-code-review"><img src="https://agentmods.dev/badge/skills/existential-birds/beagle/pytest-code-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,046 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00047 $0.01046
Opus 5.5 $0.00019 $0.00418
Sonnet 5.5 $0.00009 $0.00209
Haiku 4.5 $0.00005 $0.00105

Measured 4d ago against content hash f8e0f50c841b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pytest-code-review scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/pytest-code-review/SKILL.md · 60 lines

How it starts

The opening of the file, as written. The whole thing — 60 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pytest Code Review

Quick Reference

Issue Type Reference
pytest-asyncio strict/auto mode, AsyncMock, task cleanup references/async-testing.md
conftest.py, tmp_path, fixture scope, async try/finally cleanup references/fixtures.md
@pytest.mark.parametrize, pytest.param, indirect fixtures references/parametrize.md
Call-site patch(), AsyncMock, spec_set, mocker references/mocking.md

Review gates

Work in order. Do not assert pytest-specific problems until each applicable gate passes.

  1. Scoped files — Pass when: You list every test_*.py and any conftest.py you will cite; no findings for files outside that list.
  2. Async vs sync — Pass when: Per scoped file, you note whether it uses async def test_* / await and check project asyncio_mode (strict vs auto); if async, open references/async-testing.md before criticizing async usage.
  3. Fixtures — Pass when: If shared setup matters, you name the conftest.py path(s) or state none; for yield fixtures, confirm cleanup exists before claiming resource leaks.
  4. patch / mocks — Pass when: For any patch or 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.
  5. Findings — Pass when: Each finding includes a file path and line(s) or test node id, not a generic rule restatement.

Review Checklist

  • Async tests match configured pytest-asyncio mode (strict requires @pytest.mark.asyncio + @pytest_asyncio.fixture; auto discovers async def tests/fixtures automatically)
  • asyncio_default_fixture_loop_scope configured explicitly in pyproject.toml / pytest.ini
  • AsyncMock used for async dependencies (not Mock) and all coroutines/async mocks awaited
  • Background tasks and async resources cleaned up in finally blocks
  • Fixture scope appropriate (function for mutable state, module/session only for immutable/isolated expensive setup)
  • Yield fixtures wrap cleanup in try/finally and use tmp_path instead of hardcoded /tmp paths
  • @pytest.mark.parametrize uses pytest.param(..., id=...) / indirect= cleanly for similar cases
  • patch() targets where the symbol is used (imported/looked up), not where defined
  • Mocks use spec/spec_set and verify exact call arguments when behavior depends on them
  • Tests remain isolated (no shared module-level mock or mutable state)

Read the full file on GitHub · 60 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago Changed · +5 lines · +6 tokens per session f8e0f50c841b
  2. 2mo ago First seen · 55 lines · 41 tokens per session scan A de87136e94be

Subscribe to this mod's changes

pytest-code-review is a skill published in the GitHub repository existential-birds/beagle (91 stars, last pushed 4d ago), licensed Apache-2.0. It adds 47 tokens to every session and 1,046 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-16.

Related

pytest-code-review compared with skills from other repositories

pytest-code-review next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pytest-code-reviewexistential-birds/beagleSkill914d agoApache-2.0A47Claude Code, Codex
coding-standardsSimon-Hwang/gg-pluginsSkill24mo agononeA34Claude Code
codex-rule-routerSimon-Hwang/gg-pluginsSkill24mo agononeA39Claude Code
pr-to-go-lintergithub/gh-awSkill5.7ktodayMITA22Claude Code, Codex
splitting-oversized-modulesPostHog/posthog-fossSkill733todayMITA197Claude Code, Codex
code-reviewjrswab/axeSkill914todayApache-2.0A0Claude Code, Codex
qa-frontendPostHog/posthogSkill41ktodaynoneA216Claude Code