https://github.com/python/cpython/commit/db1c18eb6220653290a3ba9ebbe1df44394a3f19
commit: db1c18eb6220653290a3ba9ebbe1df44394a3f19
branch: main
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2024-01-21T22:29:51+02:00
summary:

gh-111803: Make test_deep_nesting from test_plistlib more strict (GH-114026)

It is no longer silently passed if RecursionError was raised for low
recursion depth.

files:
M Lib/test/test_plistlib.py

diff --git a/Lib/test/test_plistlib.py b/Lib/test/test_plistlib.py
index f47982907def21..001f86f2893f2f 100644
--- a/Lib/test/test_plistlib.py
+++ b/Lib/test/test_plistlib.py
@@ -971,12 +971,12 @@ def test_cycles(self):
         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)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to