{
  "id": "python/pytest-cov-source-not-found",
  "signature": "CoverageWarning: Module myapp was never imported. (module-not-imported)",
  "signature_zh": "CoverageWarning: 模块 myapp 从未被导入。(module-not-imported)",
  "regex": "CoverageWarning:\\ Module\\ myapp\\ was\\ never\\ imported\\.\\ \\(module\\-not\\-imported\\)",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "pytest-cov was invoked with --cov=myapp but the package was never imported during the test session, often because tests import a differently named package or the source path is wrong.",
  "root_cause_type": "generic",
  "root_cause_zh": "pytest-cov 使用 --cov=myapp 调用，但测试会话期间从未导入该包，通常是因为测试导入的包名不同或源码路径错误。",
  "versions": [
    {
      "version": "4.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "5.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "6.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Changes the report format only; the module is still never imported so coverage stays at 0%.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Marks the module as imported but bypasses the real code paths, producing misleading 100% coverage on empty lines.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "pytest --cov=myapp --cov-report=term-missing tests/",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "# .coveragerc\n[run]\nsource = src/myapp",
      "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": "2024-05-09",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}