# AssertionError: Expected mock to have been called once. Called 0 times.

- **ID:** `python/unittest-mock-return-value-not-asserted`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The mock object's call count doesn't match the expected number, often due to incorrect patch target or logic.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   with patch('module.function') as mock_func:
    call_code()
    mock_func.assert_called_once()
   ```
2. **** (85% success)
   ```
   mock_func.assert_any_call(arg1, arg2)
   ```

## Dead Ends

- **** — This masks the real problem of why the code isn't calling the mock. (70% fail)
- **** — The test becomes ineffective. (90% fail)
