diff --git a/test/common_utils.py b/test/common_utils.py index 920e999863f..5368018e971 100644 --- a/test/common_utils.py +++ b/test/common_utils.py @@ -127,7 +127,6 @@ def remove_prefix_suffix(text, prefix, suffix): expected_file += "_" + subname subname_output = " ({})".format(subname) expected_file += "_expect.pkl" - expected = None def accept_output(update_type): print("Accepting {} for {}{}:\n\n{}".format(update_type, munged_id, subname_output, output)) @@ -142,7 +141,8 @@ def accept_output(update_type): if e.errno != errno.ENOENT: raise elif ACCEPT: - return accept_output("output") + accept_output("output") + return else: raise RuntimeError( ("I got this output for {}{}:\n\n{}\n\n" @@ -150,13 +150,10 @@ def accept_output(update_type): "python {} {} --accept").format(munged_id, subname_output, output, __main__.__file__, munged_id)) if ACCEPT: - equal = False try: - equal = self.assertEqual(output, expected, prec=prec) + self.assertEqual(output, expected, prec=prec) except Exception: - equal = False - if not equal: - return accept_output("updated output") + accept_output("updated output") else: self.assertEqual(output, expected, prec=prec)