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

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

## Root Cause

在使用unittest.mock时，mock对象没有正确配置return_value或side_effect，导致测试中的调用没有被正确模拟，实际调用次数为0。

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   mock_obj.return_value = 'expected_value'
result = mock_obj()
assert result == 'expected_value'
   ```
2. **** (90% success)
   ```
   with patch('module.func') as mock_func:
    mock_func.side_effect = [1, 2]
    assert module.func() == 1
   ```

## Dead Ends

- **** — 导入错误不是主要原因，mock配置才是根本问题。 (80% fail)
- **** — 这掩盖了问题，而不是修复mock配置。 (90% fail)
