{
  "id": "python/pytest-html-report-not-generated",
  "signature": "FileNotFoundError: [Errno 2] No such file or directory: 'report.html'",
  "signature_zh": "FileNotFoundError: [Errno 2] 没有这样的文件或目录: 'report.html'",
  "regex": "FileNotFoundError:\\ \\[Errno\\ 2\\]\\ No\\ such\\ file\\ or\\ directory:\\ 'report\\.html'",
  "domain": "python",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "pytest-html plugin did not generate the report file, often because the plugin is not installed, the output path is incorrect, or the test run crashed before report generation.",
  "root_cause_type": "generic",
  "root_cause_zh": "pytest-html 插件未生成报告文件，通常是因为插件未安装、输出路径不正确，或测试运行在报告生成前崩溃。",
  "versions": [
    {
      "version": "4.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This creates an empty file that does not contain test results. The report will be useless.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This avoids the error but does not generate the report, defeating the purpose of using pytest-html.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "pip install pytest-html\npytest --html=report.html --self-contained-html",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "import tempfile\nimport os\n\nreport_path = os.path.join(tempfile.gettempdir(), 'report.html')\n# Run pytest with: --html=report_path",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-08-11",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}