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

- **ID:** `python/unittest-mock-call-count`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

使用assert_called_once_with或assert_called_once时，mock没有被调用或调用次数不符。

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   print(mock.call_count)
print(mock.mock_calls)
   ```
2. **** (85% success)
   ```
   mock.assert_any_call(args)
   ```

## Dead Ends

- **** — return_value是返回值，不是调用记录 (60% fail)
- **** — 如果代码逻辑错误，增加调用次数是错误修复 (70% fail)
