From deda2bca47732df4e1114afaecd5aec7a331a3c1 Mon Sep 17 00:00:00 2001 From: Nice Zombies Date: Thu, 11 Apr 2024 09:37:01 +0200 Subject: [PATCH] gh-117606: Truncate extremely long error message in `test_exceptions` (GH-117670) (cherry picked from commit 02f1385f8ad6bf45376377c41f106b386d3a7eb0) Co-authored-by: Nice Zombies Co-authored-by: Alex Waygood --- Lib/test/test_exceptions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 6c09c1793c8d7f..b738ec6a0324dd 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -1448,7 +1448,8 @@ def test_recursion_normalizing_infinite_exception(self): """ 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)