Skip to content

Commit db1c18e

Browse files
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.
1 parent 42d72b2 commit db1c18e

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
@@ -971,12 +971,12 @@ def test_cycles(self):
971971
self.assertIs(b['x'], b)
972972

973973
def test_deep_nesting(self):
974-
for N in [300, 100000]:
974+
for N in [50, 300, 100_000]:
975975
chunks = [b'\xa1' + (i + 1).to_bytes(4, 'big') for i in range(N)]
976976
try:
977977
result = self.decode(*chunks, b'\x54seed', offset_size=4, ref_size=4)
978978
except RecursionError:
979-
pass
979+
self.assertGreater(N, sys.getrecursionlimit())
980980
else:
981981
for i in range(N):
982982
self.assertIsInstance(result, list)

0 commit comments

Comments
 (0)