# 错误：setuptools.errors.TestFailedError：在包 'mypackage' 中未找到测试套件 'tests'

- **ID:** `python/setuptools-test-suite-not-found`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

setup.cfg 中指定的测试套件目录或模块不存在。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.9 | active | — | — |
| 3.10 | active | — | — |

## 解决方案

1. **Create the test suite directory with __init__.py** (95% 成功率)
   ```
   Run: mkdir tests; touch tests/__init__.py; touch tests/test_example.py
   ```
2. **Correct the test_suite path in setup.cfg** (90% 成功率)
   ```
   Set test_suite = tests.test_suite (if using a module).
   ```

## 无效尝试

- **Creating an empty tests directory** — An empty directory is not a valid test suite. (80% 失败率)
- **Removing the test_suite configuration** — Tests will not run automatically. (70% 失败率)
