python
config_error
ai_generated
partial
pytest 警告:未找到 'test_x' 的测试报告
PytestWarning: No test reports found for 'test_x'
ID: python/pytest-warning-summary-missing
80%修复率
82%置信度
0证据数
2025-06-15首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.10 | active | — | — | — |
根因分析
使用 pytest 插件(如 pytest-html)时,测试报告文件未生成或路径错误。
English
使用 pytest 插件(如 pytest-html)时,测试报告文件未生成或路径错误。
解决方案
-
95% 成功率 确保使用命令行参数生成报告
pytest --html=report.html
-
80% 成功率 更新插件
检查插件版本是否兼容,更新 pytest-html
无效尝试
常见但无效的做法:
-
手动创建报告
60% 失败
尝试手动创建报告文件但格式错误
-
错误配置路径
50% 失败
尝试在 conftest.py 中配置报告路径但未生效