{
  "id": "python/pytest-flaky-test-order-dependency",
  "signature": "AssertionError: assert 0 == 1\n +  where 0 = len(shared_list)",
  "signature_zh": "AssertionError: assert 0 == 1\n +  其中 0 = len(shared_list)",
  "regex": "AssertionError:\\ assert\\ 0\\ ==\\ 1\\\n\\ \\+\\ \\ where\\ 0\\ =\\ len\\(shared_list\\)",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The test depends on state modified by another test, and the order of execution changed or tests are run in parallel.",
  "root_cause_type": "generic",
  "root_cause_zh": "测试依赖于另一个测试修改的状态，而执行顺序发生变化或测试并行运行。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This is fragile and does not fix the underlying state leakage; tests may still fail in isolation.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This is unreliable and slows down tests.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "@pytest.fixture(autouse=True)\ndef reset_shared_list():\n    shared_list.clear()\n    yield",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Replace global variables with fixtures that provide fresh instances per test.",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-08-30",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}