python install_error ai_generated true

fixture 'benchmark' 未找到

fixture 'benchmark' not found

ID: python/pytest-benchmark-no-plugin

其他格式: JSON · Markdown 中文 · English
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.

generic

解决方案

  1. 95% 成功率
    pip install pytest-benchmark
    pytest --benchmark-only
  2. 90% 成功率
    echo 'pytest-benchmark' >> requirements-dev.txt
    pip install -r requirements-dev.txt

无效尝试

常见但无效的做法:

  1. 80% 失败

    Loses all benchmarking features (statistics, comparison, JSON output).

  2. 90% 失败

    Fails if the plugin is not installed; the error becomes `ModuleNotFoundError`.