[3.12] gh-117606: Truncate extremely long error message in test_exceptions (GH-117670) (#117745)

gh-117606: Truncate extremely long error message in `test_exceptions` (GH-117670)
(cherry picked from commit 02f1385f8a)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-04-11 09:53:26 +02:00 committed by GitHub
parent 04d07964f2
commit 2a508572ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1448,7 +1448,8 @@ class ExceptionTests(unittest.TestCase):
"""
rc, out, err = script_helper.assert_python_failure("-c", code)
self.assertEqual(rc, 1)
self.assertIn(b'RecursionError: maximum recursion depth exceeded', err)
expected = b'RecursionError: maximum recursion depth exceeded'
self.assertTrue(expected in err, msg=f"{expected!r} not found in {err[:3_000]!r}... (truncated)")
self.assertIn(b'Done.', out)