← 返回 Skills 市场
anderskev

Pytest Code Review

作者 Kevin Anderson · GitHub ↗ · v1.1.1 · MIT-0
cross-platform ✓ 安全检测通过
157
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install 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 u...
使用说明 (SKILL.md)

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.

  1. Scoped filesPass when: You list every test_*.py and any conftest.py you will cite; no findings for files outside that list.
  2. Async vs syncPass when: Per scoped file, you note whether it uses async def test_* / await; if yes, open references/async-testing.md before criticizing async usage.
  3. FixturesPass 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 / mocksPass 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. FindingsPass 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

  1. Are all async functions tested with async def test_*?
  2. Are fixtures properly scoped with appropriate cleanup?
  3. Can similar test cases be parametrized to reduce duplication?
  4. Are mocks tracking calls and used at the right locations?
安全使用建议
This skill appears coherent and limited to reviewing pytest test files; it requires no credentials or installs. Before enabling it, confirm you are comfortable allowing the agent access to the repository files you want reviewed (it will enumerate and read test_*.py and conftest.py). If you do not want automated agents to run this skill autonomously, keep autonomous invocation disabled for your agent or review results manually. If you need stronger assurance, inspect the SKILL.md and reference files yourself — they are bundled and readable and contain the full runtime instructions.
功能分析
Type: OpenClaw Skill Name: pytest-code-review Version: 1.1.1 The skill bundle is a legitimate tool designed to guide an AI agent through reviewing Python pytest code. It contains structured instructions in SKILL.md and comprehensive reference guides in the references/ directory covering async testing, fixtures, mocking, and parametrization. There is no evidence of malicious intent, data exfiltration, or unauthorized execution; the code snippets provided are educational examples of 'good' vs 'bad' testing patterns.
能力标签
cryptocan-make-purchases
能力评估
Purpose & Capability
Name/description (pytest test review for async, fixtures, parametrize, mocking) align with the provided SKILL.md and reference docs. There are no unrelated env vars, binaries, or install steps that would be out-of-scope for a reviewer.
Instruction Scope
Runtime instructions focus on enumerating and analyzing test_*.py and conftest.py files and consulting the bundled reference docs. The guidance limits findings to scoped files and does not instruct reading unrelated system files, environment variables, or sending data externally.
Install Mechanism
No install spec or code files are provided — this is an instruction-only skill, so nothing is downloaded or written to disk during install.
Credentials
The skill requests no environment variables, credentials, or config paths. The analysis it prescribes operates on repository test files only, which is proportionate to its stated purpose.
Persistence & Privilege
Flags: always is false (not force-included) and model invocation is allowed (default). Neither setting is excessive for this kind of skill and the skill does not request long-term persistence or modify other skills' configuration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install pytest-code-review
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /pytest-code-review 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.1
- Introduced a "Review gates" section, outlining step-by-step requirements to be met before asserting pytest-specific issues. - Clarified that all findings must reference specific file paths and lines or node IDs. - Specified review process for async vs sync tests, fixtures, and mocking, with explicit criteria for each. - No changes to review checklist or quick reference content.
v1.1.0
pytest-code-review 1.1.0 - Added a detailed review checklist for pytest async tests, fixtures, parametrization, and mocking. - Introduced clear references for async patterns, fixtures, parametrize, and mocking topics. - Provided guidance on when to load specific reference materials. - Included review questions to guide thoughtful code analysis.
元数据
Slug pytest-code-review
版本 1.1.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 2
常见问题

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 u... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 157 次。

如何安装 Pytest Code Review?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install pytest-code-review」即可一键安装,无需额外配置。

Pytest Code Review 是免费的吗?

是的,Pytest Code Review 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Pytest Code Review 支持哪些平台?

Pytest Code Review 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Pytest Code Review?

由 Kevin Anderson(@anderskev)开发并维护,当前版本 v1.1.1。

💬 留言讨论