Skip to content

Commit 6fccbea

Browse files
serhiy-storchakamiss-islington
authored andcommitted
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. (cherry picked from commit db1c18e) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 5183a5d commit 6fccbea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_plistlib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,12 +908,12 @@ def test_cycles(self):
908908
self.assertIs(b['x'], b)
909909

910910
def test_deep_nesting(self):
911-
for N in [300, 100000]:
911+
for N in [50, 300, 100_000]:
912912
chunks = [b'\xa1' + (i + 1).to_bytes(4, 'big') for i in range(N)]
913913
try:
914914
result = self.decode(*chunks, b'\x54seed', offset_size=4, ref_size=4)
915915
except RecursionError:
916-
pass
916+
self.assertGreater(N, sys.getrecursionlimit())
917917
else:
918918
for i in range(N):
919919
self.assertIsInstance(result, list)

0 commit comments

Comments
 (0)