# AssertionError: assert <Mock name='mock()' id='140735234567890'> == 5

- **ID:** `python/pytest-assert-repr-failure`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A test is comparing a mock object to a value, likely because the mock was not set up to return a value, so it returns another mock by default.

## Version Compatibility

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

## Workarounds

1. **Set the mock's return_value to the expected integer value** (95% success)
   ```
   mock = MagicMock(return_value=5)
result = mock()
assert result == 5
Or: mock.return_value = 5
   ```
2. **Ensure the code under test is calling the mock correctly** (85% success)
   ```
   Debug to see if the mock is being called. If not, the test may be comparing the mock object itself instead of its return value.
   ```

## Dead Ends

- **Comparing the mock to itself using `is`** — This does not test the actual behavior; it only checks identity. (70% fail)
- **Setting return_value to a string like '5'** — This changes the type; the test expects an integer 5. (50% fail)
