# RuntimeError: setUpClass is not called for TestCase subclass because it has no __test__ attribute

- **ID:** `python/unittest-setupclass-order-error`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

当测试类名以 'test' 开头但缺少 __test__ 属性时，unittest 将其视为非测试类

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   确保类继承自 unittest.TestCase，并命名以 test 开头
   ```
2. **** (70% success)
   ```
   自定义 loader 加载测试类，指定 loadTestsFromTestCase
   ```

## Dead Ends

- **** — unittest 框架仍会因其他原因跳过该类 (40% fail)
- **** — 如果类没有正确继承 TestCase，仍会失败 (60% fail)
