From 111864ac30126dc64a9e21d4e1b5e3d9ef4e5358 Mon Sep 17 00:00:00 2001 From: Hodlinator <172445034+hodlinator@users.noreply.github.com> Date: Mon, 26 Jan 2026 16:25:59 +0100 Subject: [PATCH] qa: Avoid duplicating output in case the diff is the same --- test/functional/test_framework/util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 03ece6f064a..d6378e880d8 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -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))