{
  "id": "python/pytest-config-error-nested-ini",
  "signature": "ERROR: /path/pytest.ini:1: unexpected line: '[tool:pytest]'\n# or: pyproject.toml: no [tool.pytest.ini_options] section found",
  "signature_zh": "ERROR: /path/pytest.ini:1: 意外的行: '[tool:pytest]'\n# 或: pyproject.toml: 未找到 [tool.pytest.ini_options] 段",
  "regex": "ERROR:\\ /path/pytest\\.ini:1:\\ unexpected\\ line:\\ '\\[tool:pytest\\]'\\\n\\#\\ or:\\ pyproject\\.toml:\\ no\\ \\[tool\\.pytest\\.ini_options\\]\\ section\\ found",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The [tool:pytest] section was written in pytest.ini (which expects [pytest]), or the pyproject.toml lacks the required [tool.pytest.ini_options] header.",
  "root_cause_type": "generic",
  "root_cause_zh": "在 pytest.ini 中写入了 [tool:pytest] 段（应使用 [pytest]），或 pyproject.toml 缺少必需的 [tool.pytest.ini_options] 头。",
  "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 reads only one config file and ignores the duplicate; the parse error remains or config is silently dropped.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "setup.cfg expects [tool:pytest] but other tools may also read it; renaming alone does not fix the section header inside.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.98,
      "how": "# pytest.ini\n[pytest]\naddopts = -ra\n\n# pyproject.toml\n[tool.pytest.ini_options]\naddopts = '-ra'\n\n# setup.cfg\n[tool:pytest]\naddopts = -ra",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "ls pytest.ini tox.ini setup.cfg pyproject.toml\n# Keep exactly one with the correct section; delete or empty the others.",
      "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": "2025-03-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}