summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-01-22 15:16:12 (GMT)
committerGitHub <noreply@github.com>2024-01-22 15:16:12 (GMT)
commitd1f731ff0839198fd22af539b6ef28d12739d4d8 (patch)
treead9eb67f4214b95d4a63e10f33f334061d167b4b /Lib
parent58fdd15d5a70b0274ed5d4fc491700138aa51cdf (diff)
downloadcpython-d1f731ff0839198fd22af539b6ef28d12739d4d8.zip
cpython-d1f731ff0839198fd22af539b6ef28d12739d4d8.tar.gz
cpython-d1f731ff0839198fd22af539b6ef28d12739d4d8.tar.bz2
[3.12] gh-111803: Make test_deep_nesting from test_plistlib more strict (GH-114026) (GH-114406)
It is no longer silently passed if RecursionError was raised for low recursion depth. (cherry picked from commit db1c18eb6220653290a3ba9ebbe1df44394a3f19) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_plistlib.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_plistlib.py b/Lib/test/test_plistlib.py
index b08abab..3f10f16 100644
--- a/Lib/test/test_plistlib.py
+++ b/Lib/test/test_plistlib.py
@@ -908,12 +908,13 @@ class TestBinaryPlistlib(unittest.TestCase):
self.assertIs(b['x'], b)
def test_deep_nesting(self):
- for N in [300, 100000]:
+ tests = [50, 100_000] if support.is_wasi else [50, 300, 100_000]
+ for N in tests:
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()//2)
else:
for i in range(N):
self.assertIsInstance(result, list)