{
  "id": "python/pytest-slow-test-warning",
  "signature": "PytestWarning: Slow test detected: test_heavy_computation took 5.23s",
  "signature_zh": "PytestWarning: 检测到慢速测试：test_heavy_computation 耗时 5.23s",
  "regex": "PytestWarning:\\ Slow\\ test\\ detected:\\ test_heavy_computation\\ took\\ 5\\.23s",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The pytest-slow-test plugin or a custom hook flags a test that exceeds a time threshold. This is a warning, not an error, but may be treated as an error if warnings are errors.",
  "root_cause_type": "generic",
  "root_cause_zh": "pytest-slow-test 插件或自定义钩子标记了超过时间阈值的测试。这是警告而非错误，但如果警告被视为错误，则会导致失败。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This reduces coverage and may remove important test cases.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This masks the performance issue and may allow very slow tests to persist.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "If warnings are errors, the test suite still fails.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Use smaller datasets, mock heavy operations, or use caching.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "@pytest.mark.slow\ndef test_heavy_computation():\n    ...\nRun with: pytest -m 'not slow'",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "@pytest.mark.slow_test_threshold(10)\ndef test_heavy_computation():\n    ...",
      "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-12-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}