python
install_error
ai_generated
true
fixture 'benchmark' 未找到
fixture 'benchmark' not found
ID: python/pytest-benchmark-no-plugin
80%修复率
90%置信度
0证据数
2024-03-05首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 4.x | active | — | — | — |
根因分析
`pytest-benchmark` 插件未安装或未启用,因此 `benchmark` fixture 不可用。
English
The `pytest-benchmark` plugin is not installed or not enabled, so the `benchmark` fixture is unavailable.
解决方案
-
95% 成功率
pip install pytest-benchmark pytest --benchmark-only
-
90% 成功率
echo 'pytest-benchmark' >> requirements-dev.txt pip install -r requirements-dev.txt
无效尝试
常见但无效的做法:
-
80% 失败
Loses all benchmarking features (statistics, comparison, JSON output).
-
90% 失败
Fails if the plugin is not installed; the error becomes `ModuleNotFoundError`.