python
system_error
ai_generated
true
CacheError: Cache file '/tmp/pytest-of-user/pytest-123/.pytest_cache/v/cache/nodeids' not found
ID: python/pytest-cache-miss-error
80%Fix Rate
82%Confidence
0Evidence
2024-10-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
Root Cause
The pytest cache directory is missing or corrupted, often due to manual deletion or concurrent test runs.
generic中文
pytest 缓存目录丢失或损坏,通常是由于手动删除或并发测试运行。
Workarounds
-
95% success Clear the cache directory and let pytest recreate it.
rm -rf .pytest_cache; pytest --cache-clear
-
90% success Disable caching with --cache-clear flag each run.
pytest --cache-clear
Dead Ends
Common approaches that don't work:
-
Creating an empty cache file manually
80% fail
The cache file format is specific; an empty file may cause parsing errors.
-
Ignoring the error and continuing
60% fail
Pytest may fail to run or report incorrect results without cache.