# TypeError: assertRaises() arg 1 must be an exception type or tuple of exception types

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

## Root Cause

Passing a non-exception object (e.g., a string or function) as the first argument to assertRaises.

## Version Compatibility

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

## Workarounds

1. **** (99% success)
   ```
   with self.assertRaises(ValueError):
    function_that_raises()
   ```
2. **** (99% success)
   ```
   with self.assertRaises((ValueError, TypeError)):
    function_that_raises()
   ```

## Dead Ends

- **** — assertRaises expects the exception class, not an instance. (90% fail)
- **** — Strings are not valid exception types. (95% fail)
