From dfe2205bc7bea7eebd6b463bcb30c7369ef0a734 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Mon, 17 Aug 2020 13:57:43 +1200 Subject: [PATCH] add a message when list of valid/invalid excuses fails to validate --- britney2/excusefinder.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/britney2/excusefinder.py b/britney2/excusefinder.py index 20044b1..75b7497 100644 --- a/britney2/excusefinder.py +++ b/britney2/excusefinder.py @@ -619,10 +619,15 @@ class ExcuseFinder(object): # check that the list of actionable items matches the list of valid # excuses - assert valid == {x for x in excuses if excuses[x].is_valid} + assert_sets_equal(valid, {x for x in excuses if excuses[x].is_valid}) # check that the rdeps for all invalid excuses were invalidated - assert invalidated == {x for x in excuses if not excuses[x].is_valid} + assert_sets_equal(invalidated, {x for x in excuses if not excuses[x].is_valid}) actionable_items = {x for x in actionable_items if x.name in valid} return excuses, actionable_items + + +def assert_sets_equal(a, b): + if a != b: + raise AssertionError("sets not equal a-b {} b-a {}".format(a-b, b-a))