python
config_error
ai_generated
true
FixtureLookupError: fixture 'db' not found in available fixtures: ['tmpdir', 'capsys']
ID: python/pytest-fixure-order-error
80%Fix Rate
89%Confidence
0Evidence
2024-10-12First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 7.4.0 | active | — | — | — |
Root Cause
测试函数引用了未定义的 fixture 名称
generic中文
测试函数引用了未定义的 fixture 名称
Workarounds
-
95% success
@pytest.fixture def db(): ...
-
85% success
确保 fixture 名称一致
Dead Ends
Common approaches that don't work:
-
40% fail
可能与其他 fixture 冲突
-
90% fail
pytest 不支持该参数