# AssertionError: assert <Mock id='140123456789'> == 5

- **ID:** `python/pytest-assertion-rewrite-error`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

在断言中使用了 mock 对象而非实际返回值，导致比较失败。

## Version Compatibility

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

## Workarounds

1. **** (100% success)
   ```
   `mock_obj.return_value = 5` 然后断言 `mock_obj() == 5`。
   ```
2. **** (90% success)
   ```
   `mock_obj.assert_called_once_with(参数)` 验证调用参数。
   ```

## Dead Ends

- **** — mock 对象始终不等于任何值，除非配置了 return_value。 (100% fail)
- **** — 如果调用参数不匹配，仍会失败，且不能验证返回值。 (50% fail)
