{
  "id": "python/pytest-cache-last-failed",
  "signature": "pytest-cache: no previously failed tests found",
  "signature_zh": "pytest-cache: 未找到之前失败的测试",
  "regex": "pytest\\-cache:\\ no\\ previously\\ failed\\ tests\\ found",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "When using pytest --lf (last failed) or --ff (first failed), no previous test run data is available in the cache, often because the cache file is missing or the test suite has not been run before.",
  "root_cause_type": "generic",
  "root_cause_zh": "当使用pytest --lf（上次失败）或--ff（首次失败）时，缓存中没有之前的测试运行数据，通常是因为缓存文件缺失或测试套件之前未运行过。",
  "versions": [
    {
      "version": "7.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Running pytest --clear-cache to reset the cache",
      "why_fails": "This removes any existing cache, making the situation worse if there was data.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Manually creating a cache file with dummy data",
      "why_fails": "This is error-prone and may cause pytest to misbehave if the format is incorrect.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Run the full test suite first to populate the cache, then use --lf",
      "success_rate": 0.95,
      "how": "First run: pytest\nThen run: pytest --lf\nThis will re-run only the tests that failed in the previous run.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use --co (cache-show) to inspect the cache contents",
      "success_rate": 0.8,
      "how": "Run: pytest --co\nThis shows the cached results. If empty, run the full suite first.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-02-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}