{
  "id": "python/pytest-warnings-as-errors",
  "signature": "Failed: Warnings detected: DeprecationWarning: 'collections.OrderedDict' is deprecated",
  "signature_zh": "失败: 检测到警告: DeprecationWarning: 'collections.OrderedDict' 已弃用",
  "regex": "Failed:\\ Warnings\\ detected:\\ DeprecationWarning:\\ 'collections\\.OrderedDict'\\ is\\ deprecated",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "pytest was configured with -W error to treat warnings as errors. A deprecation warning from the code or a dependency caused the test to fail.",
  "root_cause_type": "generic",
  "root_cause_zh": "pytest 配置了 -W error 将警告视为错误。来自代码或依赖项的弃用警告导致测试失败。",
  "versions": [
    {
      "version": "7.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This hides the warning but does not fix the deprecated code. The warning will still appear in other contexts.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This hides all warnings, including important ones, and may mask future compatibility issues.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "# Replace collections.OrderedDict with dict\n# Or update the dependency to a newer version",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "# pytest.ini\nfilterwarnings =\n    ignore::DeprecationWarning:collections",
      "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.9,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-09",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}