mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-16 08:22:46 +00:00
qa: Avoid duplicating output in case the diff is the same
This commit is contained in:
parent
c2e28d455a
commit
111864ac30
@ -75,7 +75,10 @@ def summarise_dict_differences(thing1, thing2):
|
||||
def assert_equal(thing1, thing2, *args):
|
||||
if thing1 != thing2 and not args and isinstance(thing1, dict) and isinstance(thing2, dict):
|
||||
d1,d2 = summarise_dict_differences(thing1, thing2)
|
||||
raise AssertionError("not(%s == %s)\n in particular not(%s == %s)" % (thing1, thing2, d1, d2))
|
||||
if d1 != thing1 or d2 != thing2:
|
||||
raise AssertionError(f"not({thing1!s} == {thing2!s})\n in particular not({d1!s} == {d2!s})")
|
||||
else:
|
||||
raise AssertionError(f"not({thing1!s} == {thing2!s})")
|
||||
if thing1 != thing2 or any(thing1 != arg for arg in args):
|
||||
raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user