{
  "id": "python/setuptools-deprecated-test-command",
  "signature": "SetuptoolsDeprecationWarning: 'test' command is deprecated. Use pytest instead.",
  "signature_zh": "SetuptoolsDeprecationWarning：'test' 命令已弃用。请改用 pytest。",
  "regex": "SetuptoolsDeprecationWarning:\\ 'test'\\ command\\ is\\ deprecated\\.\\ Use\\ pytest\\ instead\\.",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "setuptools 58+ removed the built-in 'test' command integration with setup.py. Running 'python setup.py test' triggers this deprecation and will fail outright in setuptools 72+.",
  "root_cause_type": "generic",
  "root_cause_zh": "setuptools 58+ 移除了 setup.py 内置的 'test' 命令集成。运行 'python setup.py test' 会触发此弃用警告，并在 setuptools 72+ 中彻底失败。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Downgrading setuptools breaks other packages requiring modern setuptools (e.g. numpy, cryptography) and leaves you on an unsupported release.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "tests_require was removed alongside the test command; it no longer has any effect.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.98,
      "how": "Run pytest directly: python -m pytest tests/ . Configure pytest via pyproject.toml [tool.pytest.ini_options].",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.92,
      "how": "Use tox for multi-env testing: pip install tox && tox. Define [tox] envlist in tox.ini and let tox invoke pytest.",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-01-22",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}