# TypeError: assertRaises() missing 1 required positional argument: 'callable'

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

## Root Cause

unittest.TestCase.assertRaises can be used as a context manager or called with a callable plus args. Calling it with only an exception class and no callable (or not using `with`) raises TypeError.

## Version Compatibility

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

## Workarounds

1. **** (98% success)
   ```
   with self.assertRaises(ValueError):
    int('not-a-number')
   ```
2. **** (95% success)
   ```
   self.assertRaises(ValueError, int, 'not-a-number')
# or with keyword args:
self.assertRaises(ValueError, int, base=2, x='zz')
   ```

## Dead Ends

- **** — assertRaises expects an exception class or tuple of classes, not a string; passing a string causes a different TypeError about the expected type. (95% fail)
- **** — This actually works, but if the user forgets the second argument entirely (the common mistake), it still raises the same TypeError; the dead-end is the mental model of 'just add the exception class'. (80% fail)
