# fixture 'benchmark' 未找到

- **ID:** `python/pytest-benchmark-no-plugin`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

`pytest-benchmark` 插件未安装或未启用，因此 `benchmark` fixture 不可用。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 4.x | active | — | — |

## 解决方案

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

## 无效尝试

- **** — Loses all benchmarking features (statistics, comparison, JSON output). (80% 失败率)
- **** — Fails if the plugin is not installed; the error becomes `ModuleNotFoundError`. (90% 失败率)
