python
install_error
ai_generated
true
fixture 'benchmark' not found Available fixtures: cache, capfd, capsys, monkeypatch, ...
ID: python/pytest-benchmark-no-benchmark-fixture
80%Fix Rate
88%Confidence
0Evidence
2024-10-18First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 4.x | active | — | — | — |
Root Cause
pytest-benchmark is not installed or is installed in a different Python environment than the one running pytest.
generic中文
pytest-benchmark 未安装,或安装在与运行 pytest 不同的 Python 环境中。
Workarounds
-
98% success
python -m pip install pytest-benchmark python -m pytest --benchmark-only -q
-
90% success
which pytest pytest --version python -m pytest --version python -m pip install pytest-benchmark
Dead Ends
Common approaches that don't work:
-
80% fail
The plugin registers the fixture via entry points; a plain import does not register it if the package is missing.
-
70% fail
Shadows the real plugin and provides no timing functionality; tests pass but measure nothing.