Kaydet (Commit) 6fce7ea8 authored tarafından Victor Stinner's avatar Victor Stinner Kaydeden (comit) GitHub

bpo-30445: Allow appended output in RecursionError message (#3356)

Running under coverage sometimes causes 'in comparison' to be added to the end of the RecursionError message, which is acceptable.

Patched by Maria Mckinley

(cherry picked from commit 3480ef9d)
üst 63b3f2b1
...@@ -344,7 +344,8 @@ class TracebackFormatTests(unittest.TestCase): ...@@ -344,7 +344,8 @@ class TracebackFormatTests(unittest.TestCase):
# 2nd last line contains the repetition count # 2nd last line contains the repetition count
self.assertEqual(actual[:-2], expected[:-2]) self.assertEqual(actual[:-2], expected[:-2])
self.assertRegex(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 # Check the recursion count is roughly as expected
rec_limit = sys.getrecursionlimit() rec_limit = sys.getrecursionlimit()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment