{
  "id": "python/pytest-random-order-fixture-collision",
  "signature": "pytest.PytestUnraisableExceptionWarning: Exception ignored in: <sqlite3.Connection object>",
  "signature_zh": "pytest.PytestUnraisableExceptionWarning: 忽略异常: <sqlite3.Connection 对象>",
  "regex": "pytest\\.PytestUnraisableExceptionWarning:\\ Exception\\ ignored\\ in:\\ <sqlite3\\.Connection\\ object>",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "pytest-randomly reorders tests; a fixture that relied on side effects from a previously-run test (implicit ordering) now runs first, leaving resources in an unexpected state and triggering unraisable exceptions at GC.",
  "root_cause_type": "generic",
  "root_cause_zh": "pytest-randomly 重排测试；依赖先前测试副作用的 fixture（隐式顺序）现在最先运行，资源处于意外状态，GC 时触发不可抛出异常。",
  "versions": [
    {
      "version": "3.15.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Hides the ordering bug; CI with a different seed will still fail, and the fixture remains order-dependent.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Makes local runs deterministic but the underlying implicit dependency remains; any seed change re-exposes the bug.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.93,
      "how": "@pytest.fixture\ndef db(tmp_path):\n    p = tmp_path / 'test.db'\n    conn = sqlite3.connect(p)\n    conn.executescript(SCHEMA)\n    yield conn\n    conn.close()",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "pytest --randomly-seed=last -x -q\n# Reproduce, then refactor fixtures to remove cross-test state",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-12-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}