{
  "id": "python/pytest-capture-logging-handler",
  "signature": "logging.Handler: 'caplog' fixture requires 'logging' plugin, but logging is not configured",
  "signature_zh": "日志处理程序：'caplog' fixture需要'logging'插件，但日志未配置",
  "regex": "logging\\.Handler:\\ 'caplog'\\ fixture\\ requires\\ 'logging'\\ plugin,\\ but\\ logging\\ is\\ not\\ configured",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "pytest的caplog fixture需要pytest的logging插件，如果插件被禁用或未安装，就会报错。",
  "root_cause_type": "generic",
  "root_cause_zh": "pytest的caplog fixture需要pytest的logging插件，如果插件被禁用或未安装，就会报错。",
  "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": "问题不是pytest未安装，而是插件未启用",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "caplog是pytest内置的，手动配置不会影响pytest的捕获",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "pip install pytest-logging\n# 在pytest.ini中添加\n[pytest]\nlog_cli = true",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "[pytest]\naddopts = -p no:logging",
      "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.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}