# SetuptoolsDeprecationWarning: 'test' command is deprecated. Use pytest instead.

- **ID:** `python/setuptools-deprecated-test-command`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## 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+.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## Workarounds

1. **** (98% success)
   ```
   Run pytest directly: python -m pytest tests/ . Configure pytest via pyproject.toml [tool.pytest.ini_options].
   ```
2. **** (92% success)
   ```
   Use tox for multi-env testing: pip install tox && tox. Define [tox] envlist in tox.ini and let tox invoke pytest.
   ```

## Dead Ends

- **** — Downgrading setuptools breaks other packages requiring modern setuptools (e.g. numpy, cryptography) and leaves you on an unsupported release. (70% fail)
- **** — tests_require was removed alongside the test command; it no longer has any effect. (85% fail)
