Token导航 LogoToken导航

Agent Skill · 开发

pytest-test-master-kay(pytest 测试大师凯)

用于辅助 Python 项目开发、测试、依赖管理和常见框架工作流。它适合让 Agent 阅读 Python 代码、定位测试问题、整理运行命令、生成脚本或分析数据处理逻辑。使用时需要确认项目虚拟环境、依赖版本和测试入口;涉及执行脚本、读写文件、访问数据库或调用外部 API 时,应先明确运行目录和输入输出范围,避免误改生产数据。

pytest-test-master-kay 是开发类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为需要联网;许可证为 MIT-0,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 7,221。

总安装 3,966周安装 162GitHub Stars 公开资料未说明下载 1,283核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
1.0.0

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pytest-test-master-kay(pytest 测试大师凯)
来源仓库:https://github.com/shenghoo123-png/pytest-test-master-kay
安装命令:
openclaw skills install pytest-test-master-kay
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install pytest-test-master-kay

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

提供 pytest fixtures 用法、mock/patch 操作、参数化测试、coverage 报告解读和测试数据生成的专项指导和示例。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install pytest-test-master-kay;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

pytest-test-master-kay 怎么安装?

在终端执行 openclaw skills install pytest-test-master-kay。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

pytest-test-master-kay 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

pytest-test-master-kay 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

pytest-test-master-kay 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

pytest-test-master-kay 用的人多吗?

公开数据是累计安装 3,966 次,近一周安装 162 次,下载 1,283 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

pytest-test-master-kay 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
pytest-test-master-kay

pytest 测试大师凯 · 本页

3,966—需要联网MIT-0通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

pytest-test-master — pytest 专项技能

痛点

  • 会写测试,但 fixtures 用得乱,setup/teardown 纠缠不清
  • 不知道什么时候用 scope、params、yield_fixture
  • mock/patch 混用,容易写错 target 路径导致假通过
  • conftest.py 越写越乱,跨文件 fixtures 共享搞不清
  • parametrize 只会简单列表,多维度组合测试不知怎么写
  • coverage 跑出来了但不知道怎么看报告找盲区
  • 测试数据靠手写 hardcode,faker 和 factory_boy 不知道哪个场景用

场景

  • 接手老项目,看到 conftest.py 里有 200 行不知道从哪入手
  • 想用 pytest-mock 替代 unittest.mock 但不确定哪个更合适
  • 需要参数化测试覆盖 10 种边界组合,手动写 10 个 test 函数太累
  • 新人入职,问你 fixture scope 怎么选,autouse 什么时候开
  • 想知道 coverage 怎么配合 CI,threshold 怎么设才合理
  • 想快速生成真实感测试数据而不是 all() equal 1

定价

  • Free:fixtures 基础用法 + mock/patch 入门(单文件示例)
  • Pro 19元:conftest 进阶 + parametrize 组合 + pytest-cov 报告解读 + faker 集成
  • Team 49元:factory_boy 高级模式 + CI/CD coverage gate + 全量示例模板 + 技术支持

指令格式

子命令

pytest-test-master fixtures [topic]    # fixtures 最佳实践
pytest-test-master mock [topic]         # mock/patch 使用模式
pytest-test-master parametrize [topic]  # 参数化测试
pytest-test-master coverage [topic]     # coverage 报告分析
pytest-test-master data [topic]         # 测试数据生成
pytest-test-master --list               # 列出所有可用主题
pytest-test-master --all                # 输出完整指南(Pro/Team)

fixtures 子主题

pytest-test-master fixtures scope       # function/class/module/session 区别
pytest-test-master fixtures yield        # yield_fixture vs setup
pytest-test-master fixtures params       # 参数化 fixture
pytest-test-master fixtures autouse     # autouse 自动执行
pytest-test-master fixtures request      # request.fixture_registry
pytest-test-master fixtures teardown     # yield vs addfinalizer
pytest-test-master fixtures session      # session-scope 跨文件共享
pytest-test-master fixtures inject       # 依赖注入模式

mock 子主题

pytest-test-master mock patch            # @patch 装饰器用法
pytest-test-master mock mock_obj         # MagicMock/PropertyMock
pytest-test-master mock assert           # 断言调用次数和参数
pytest-test-master mock freeze           # freeze_time 时间冻结
pytest-test-master mock spy              # Spy 模式保留真实行为
pytest-test-master mock scope            # session/class/function mock scope
pytest-test-master mock common          # 常见错误和修复

parametrize 子主题

pytest-test-master parametrize basic     # @pytest.mark.parametrize
pytest-test-master parametrize ids       # 自定义测试 ID
pytest-test-master parametrize indirect  # 间接参数化
pytest-test-master parametrize combine   # 多个 parametrize 组合
pytest-test-master parametrize generate  # 动态生成参数
pytest-test-master parametrize product  # 笛卡尔积组合

coverage 子主题

pytest-test-master coverage report      # coverage report 阅读
pytest-test-master coverage html        # HTML 报告生成
pytest-test-master coverage xml         # CI 集成 XML 报告
pytest-test-master coverage threshold  # 阈值设置
pytest-test-master coverage combine    # 多文件合并覆盖
pytest-test-master coverage exclude    # 排除文件和行
pytest-test-master coverage debug      # 调试覆盖问题

data 子主题

pytest-test-master data faker          # Faker.py 用法
pytest-test-master data factory         # factory_boy 工厂模式
pytest-test-master data fixture         # fixture 中集成数据生成
pytest-test-master data fixture         # @pytest.fixture 结合 faker
pytest-test-master data seed           # 固定种子复现数据
pytest-test-master data strategy       # 不同数据策略

Free 内容示例(fixtures scope)

# fixture scope 四种级别
import pytest

# function(默认):每个测试函数前后执行
@pytest.fixture
def db_connection():
    conn = create_connection()
    yield conn  # yield 前 = setup,yield 后 = teardown
    conn.close()

# class:类的所有测试方法共享同一个实例
@pytest.fixture(scope="class")
def test_client():
    client = FlaskClient()
    client.connect()
    yield client
    client.disconnect()

# module:一个模块只执行一次
@pytest.fixture(scope="module")
def django_db_setup():
    # 模块级别 setup
    pass

# session:整个测试 session 只执行一次
@pytest.fixture(scope="session")
def base_url():
    return "https://api.example.com"

Free 内容示例(mock patch)

# @patch 装饰器:mock 外部依赖
from unittest.mock import patch

@patch("myapp.service.requests.get")
def test_fetch_user(mock_get):
    mock_get.return_value = Mock(status_code=200, json=lambda: {"name": "Alice"})
    result = fetch_user(1)
    assert result["name"] == "Alice"
    # mock_get.assert_called_once()  # 可选断言

输出格式

每个子命令输出:

  1. 概念说明(何时用)
  2. 代码示例(拿来即用)
  3. 常见错误(避坑指南)
  4. 进阶技巧(Pro/Team 内容会注明)

与 test-master 的互补关系

  • test-master:测试数据生成(输入)
  • pytest-test-master:pytest 编写技巧(过程)
  • 两者配合:生成数据 → 编写测试 → 覆盖报告

平台分布

OpenClaw

70.84%
按下载量换算909

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills