]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111803: Make test_deep_nesting from test_plistlib more strict (GH-114026)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 21 Jan 2024 20:29:51 +0000 (22:29 +0200)
committerGitHub <noreply@github.com>
Sun, 21 Jan 2024 20:29:51 +0000 (22:29 +0200)
It is no longer silently passed if RecursionError was raised for low
recursion depth.

Lib/test/test_plistlib.py

index f47982907def211586c87186decb45504b5d4e6d..001f86f2893f2fe5f27b5ca49050183b14b1cf61 100644 (file)
@@ -971,12 +971,12 @@ class TestBinaryPlistlib(unittest.TestCase):
         self.assertIs(b['x'], b)
 
     def test_deep_nesting(self):
-        for N in [300, 100000]:
+        for N in [50, 300, 100_000]:
             chunks = [b'\xa1' + (i + 1).to_bytes(4, 'big') for i in range(N)]
             try:
                 result = self.decode(*chunks, b'\x54seed', offset_size=4, ref_size=4)
             except RecursionError:
-                pass
+                self.assertGreater(N, sys.getrecursionlimit())
             else:
                 for i in range(N):
                     self.assertIsInstance(result, list)