From: Nice Zombies Date: Thu, 11 Apr 2024 07:37:01 +0000 (+0200) Subject: gh-117606: Truncate extremely long error message in `test_exceptions` (#117670) X-Git-Tag: v3.13.0b1~487 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=02f1385f8ad6bf45376377c41f106b386d3a7eb0;p=thirdparty%2FPython%2Fcpython.git gh-117606: Truncate extremely long error message in `test_exceptions` (#117670) Co-authored-by: Alex Waygood --- diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 36fd89dbb889..1224f143b544 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -1451,7 +1451,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)