{
  "id": "python/pytest-warning-as-error",
  "signature": "pytest.PytestDeprecationWarning: The 'func' argument is deprecated, use 'function' instead",
  "signature_zh": "pytest.PytestDeprecationWarning: 'func' 参数已弃用，请改用 'function'",
  "regex": "pytest\\.PytestDeprecationWarning:\\ The\\ 'func'\\ argument\\ is\\ deprecated,\\ use\\ 'function'\\ instead",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Using a deprecated parameter in a pytest function, which is treated as an error due to the -W error::pytest.PytestDeprecationWarning filter.",
  "root_cause_type": "generic",
  "root_cause_zh": "在 pytest 函数中使用了已弃用的参数，由于 -W error::pytest.PytestDeprecationWarning 过滤器，这被视为错误。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This hides important deprecation notices that should be addressed for future compatibility.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This is a temporary fix that prevents using newer features and security patches.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Update the code to use the new parameter: replace `func` with `function` in the call.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Temporarily allow the warning in pytest.ini: `filterwarnings = default::pytest.PytestDeprecationWarning`",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-06-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}