返回顶部
p

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.1.0
安全检测
已通过
104
下载量
0
收藏
概述
安装方式
版本历史

pytest-code-review

# Pytest Code Review ## Quick Reference | Issue Type | Reference | |------------|-----------| | async def test_*, AsyncMock, await patterns | [references/async-testing.md](references/async-testing.md) | | conftest.py, factory fixtures, scope, cleanup | [references/fixtures.md](references/fixtures.md) | | @pytest.mark.parametrize, DRY patterns | [references/parametrize.md](references/parametrize.md) | | AsyncMock tracking, patch patterns, when to mock | [references/mocking.md](references/mocking.md) | ## 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?

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 pytest-code-review-1776088089 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 pytest-code-review-1776088089 技能

通过命令行安装

skillhub install pytest-code-review-1776088089

下载 Zip 包

⬇ 下载 pytest-code-review v1.1.0

文件大小: 11.02 KB | 发布时间: 2026-4-14 14:34

v1.1.0 最新 2026-4-14 14:34
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.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部