python-testing · AI Skill 用途与安装 · iSkills.cc
用pytest编写Python测试,包括TDD方法、fixture和mock。
分类:测试排错
来源仓库:affaan-m/ecc
适合用来做什么
- 使用pytest为这个函数编写一个参数化的测试用例。
- 请解释如何使用mocking在Python中进行单元测试。
不适合的情况
- Don't use complex conditionals in tests**: Keep tests simple - **Don't ignore test failures**: All tests must pass - **Don't test third-party code**: Trust libraries to work - **Don't share
- Don't use print statements**: Use assertions and pytest output - **Don't write tests that are too brittle**: Avoid over-specific mocks ## Common Patterns ### Testing API Endpoints (FastAPI/
安装 python-testing
npx skills add https://www.iskills.cc/skills/affaan-m/ecc/python-testing/SKILL.md
在本机终端执行安装命令。安装前请阅读原始说明,确认所需工具、账号和权限。