# TypeError: 'MagicMock' object is not callable

- **ID:** `python/unittest-mock-magicmock-not-callable`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A MagicMock instance was used where a callable is expected, but the mock was not configured to be callable, or the mock's return_value was accessed incorrectly.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   mock_func = MagicMock()
mock_func.return_value = 42
assert mock_func() == 42
   ```
2. **** (92% success)
   ```
   mock_func = MagicMock()
mock_func.side_effect = lambda x: x * 2
assert mock_func(5) == 10
   ```

## Dead Ends

- **** — Mock is also not callable by default. The issue is configuration, not the mock class. (85% fail)
- **** — If the mock is not callable, adding parentheses will still raise TypeError. The mock must be configured as callable. (90% fail)
