# fixture 'benchmark' 未找到
可用 fixtures: cache, capfd, capsys, monkeypatch, ...

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

## 根因

pytest-benchmark 未安装，或安装在与运行 pytest 不同的 Python 环境中。

## 版本兼容性

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

## 解决方案

1. **** (98% 成功率)
   ```
   python -m pip install pytest-benchmark
python -m pytest --benchmark-only -q
   ```
2. **** (90% 成功率)
   ```
   which pytest
pytest --version
python -m pytest --version
python -m pip install pytest-benchmark
   ```

## 无效尝试

- **** — The plugin registers the fixture via entry points; a plain import does not register it if the package is missing. (80% 失败率)
- **** — Shadows the real plugin and provides no timing functionality; tests pass but measure nothing. (70% 失败率)
