]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-117606: Truncate extremely long error message in `test_exceptions` (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 11 Apr 2024 07:53:26 +0000 (09:53 +0200)
committerGitHub <noreply@github.com>
Thu, 11 Apr 2024 07:53:26 +0000 (07:53 +0000)
gh-117606: Truncate extremely long error message in `test_exceptions` (GH-117670)
(cherry picked from commit 02f1385f8ad6bf45376377c41f106b386d3a7eb0)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Lib/test/test_exceptions.py

index 6c09c1793c8d7f681537edfe9156bfd409db36db..b738ec6a0324ddbdee4bea126cfc3de4e5d814ba 100644 (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)