# ModuleNotFoundError: No module named 'tests.test_api'

- **ID:** `python/pytest-failed-to-import-test-module`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

pytest无法导入测试模块，通常因为模块路径不在PYTHONPATH中，或者包结构不正确。

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.7 | active | — | — |

## Workarounds

1. **** (80% success)
   ```
   touch tests/__init__.py
   ```
2. **** (90% success)
   ```
   [pytest]
pythonpath = .
   ```

## Dead Ends

- **** — 临时修改路径，可能影响其他测试，且不优雅。 (60% fail)
- **** — 文件名不是根本原因，除非命名不符合pytest规则。 (70% fail)
