Consider this:
import pytest
def test_it():
assert pytest.approx({"a": 1, "b": 2}) == {"a": 1, "b": 2, "c": 3}
Currently results in this output:
def test_it():
> assert pytest.approx({"a": 1, "b": 2}) == {"a": 1, "b": 2, "c": 3}
E AssertionError: assert approx({'a': ... 2 ± 2.0e-06}) == {'a': 1, 'b': 2, 'c': 3}
E
E comparison failed. Mismatched elements: 0 / 2:
E Max absolute difference: -inf
E Max relative difference: -inf
E Index | Obtained | Expected
The "comparison failed" messages doesn't actually show anything wrong (no mismatches), which is confusing.
I think it should give a message like ApproxSequence does when the lengths don't match:
E Impossible to compare mappings with different sizes.
E Lengths: 2 and 3