8000 gh-111803: Use more reasonable nesting in test_plistlib's test_deep_nesting by ronaldoussoren · Pull Request #114020 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111803: Use more reasonable nesting in test_plistlib's test_deep_nesting #114020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions Lib/test/test_plistlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,15 @@ def test_cycles(self):
self.assertIs(b['x'], b)

def test_deep_nesting(self):
for N in [300, 100000]:
for N in [50, 100]:
with self.subTest(N=N):
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
else:
for i in range(N):
self.assertIsInstance(result, list)
self.assertEqual(len(result), 1)
result = result[0]
self.assertEqual(result, 'seed')
result = self.decode(*chunks, b'\x54seed', offset_size=4, ref_size=4)
for i in range(N):
self.assertIsInstance(result, list)
self.assertEqual(len(result), 1)
result = result[0]
self.assertEqual(result, 'seed')

def test_large_timestamp(self):
# Issue #26709: 32-bit timestamp out of range
Expand Down
0