pytest - Python 的 pytest 测试模式指南
提供使用 pytest 编写 Python 测试的代码模式与指南,涵盖 Fixture、Mock、参数化及标记等功能。
标签
更新于: 2026-09-15能力
典型输入
典型输出
该技能可以做什么
- 编写 pytest 测试结构
- 创建 pytest Fixture
- 使用 patch 模拟依赖
- 参数化测试用例
- 应用 pytest 标记
- 编写异步 pytest 测试
输入
- Python 源代码
- 测试需求规范
输出
- pytest 测试代码
- pytest 命令行指令
要求
- Python 运行环境
- pytest 依赖包
