# AssertionError: setUpClass not called before test methods

- **ID:** `python/unittest-setupclass-not-called`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The test class does not inherit from unittest.TestCase, or setUpClass is defined incorrectly (e.g., as an instance method).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (99% success)
   ```
   class TestMyClass(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        ...
   ```
2. **** (90% success)
   ```
   @pytest.fixture(scope='class')
def setup():
    ...
   ```

## Dead Ends

- **** — setUp is called for each test, not once for the class. (70% fail)
- **** — If the class doesn't inherit from TestCase, it won't be recognized. (50% fail)
