# AssertionError: assert {'a': 1} == {'a': 1}
  Omitting 1 identical items, use -vv to show
  Full diff:
  - {'a': 1}
  + {'a': 1}
  ?  ^   ^
  + {'a': 1}
  ?  ^   ^

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

## Root Cause

The assertion compares objects that look equal in repr but differ in type or nested identity (e.g., int vs bool, numpy array vs list, or a custom __eq__ that returns a non-bool). pytest's assertion rewriting hides the real difference.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7.x | active | — | — |
| 8.x | active | — | — |

## Workarounds

1. **** (85% success)
   ```
   Print the types and use a type-strict comparison:

def test_x():
    actual = get()
    assert type(actual) is dict and actual == {'a': 1}, f"{type(actual)=} {actual=}"
   ```
2. **** (92% success)
   ```
   For numpy/pandas, use the dedicated assertion helpers:

import numpy as np
np.testing.assert_array_equal(actual, expected)
import pandas as pd
pd.testing.assert_frame_equal(df1, df2)
   ```

## Dead Ends

- **** — Identity comparison almost always fails for equal-but-distinct objects and produces a more confusing error. (85% fail)
- **** — Only changes the error formatting; the underlying inequality is still there. (90% fail)
