| 84 | return d1, d2 |
| 85 | |
| 86 | def assert_equal(thing1, thing2, *args): |
| 87 | if thing1 != thing2 and not args and isinstance(thing1, dict) and isinstance(thing2, dict): |
| 88 | d1,d2 = summarise_dict_differences(thing1, thing2) |
| 89 | if d1 != thing1 or d2 != thing2: |
| 90 | raise AssertionError(f"not({thing1!s} == {thing2!s})\n in particular not({d1!s} == {d2!s})") |
| 91 | else: |
| 92 | raise AssertionError(f"not({thing1!s} == {thing2!s})") |
| 93 | if thing1 != thing2 or any(thing1 != arg for arg in args): |
| 94 | raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args)) |
| 95 | |
| 96 | def assert_not_equal(thing1, thing2, *, error_message=""): |
| 97 | if thing1 == thing2: |