# AttributeError: 'TestLoader' object has no attribute 'loadTestsFromName'

- **ID:** `python/unittest-testloader-error`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

在 Python 3.12 中，TestLoader 的方法名可能已更改或已弃用

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   loader = unittest.TestLoader(); suite = loader.loadTestsFromTestCase(MyTest)
   ```
2. **** (85% success)
   ```
   suite = unittest.defaultTestLoader.discover('tests')
   ```

## Dead Ends

- **** — 新版本已移除 (90% fail)
- **** — 失去动态加载功能 (40% fail)
