]> granicus.if.org Git - python/commitdiff
bpo-30445: Allow appended output in RecursionError message
authorcodedragon <mariak@mariakathryn.net>
Wed, 24 May 2017 21:23:46 +0000 (14:23 -0700)
committerZachary Ware <zachary.ware@gmail.com>
Wed, 24 May 2017 21:23:46 +0000 (16:23 -0500)
Running under coverage sometimes causes 'in comparison' to be added to the end of the RecursionError message, which is acceptable.

Patched by Maria Mckinley

Lib/test/test_traceback.py

index 7276bc7ee7907996f94f2ca7bcb19eabb6ebdf13..e4833535890d157f88643403d157f1d1d1695d81 100644 (file)
@@ -344,7 +344,8 @@ class TracebackFormatTests(unittest.TestCase):
         # 2nd last line contains the repetition count
         self.assertEqual(actual[:-2], expected[:-2])
         self.assertRegex(actual[-2], expected[-2])
-        self.assertEqual(actual[-1], expected[-1])
+        # last line can have additional text appended
+        self.assertIn(expected[-1], actual[-1])
 
         # Check the recursion count is roughly as expected
         rec_limit = sys.getrecursionlimit()