{
  "id": "python/pytest-caplog-no-logs",
  "signature": "AssertionError: assert 'expected log' in []",
  "signature_zh": "AssertionError: assert 'expected log' in []",
  "regex": "AssertionError:\\ assert\\ 'expected\\ log'\\ in\\ \\[\\]",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The caplog fixture did not capture any log messages, often because the logging level is too high or the logger is not configured.",
  "root_cause_type": "generic",
  "root_cause_zh": "caplog fixture 未捕获任何日志消息，通常是因为日志级别过高或日志记录器未配置。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If the logger is not configured to propagate or the handler is missing, increasing the level may not help.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This does not test the logging behavior and is not a proper fix.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "caplog.set_level(logging.INFO)\nEnsure the logger used in the code under test has propagate=True (default) and is not filtered.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "with caplog.at_level(logging.INFO):\n    my_function()\nassert 'expected log' in caplog.text",
      "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-04-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}