gh-90473: Decrease recursion limit and skip tests on WASI (GH-92803)

This commit is contained in:
Christian Heimes 2022-05-19 12:43:16 +02:00 committed by GitHub
parent e48ac9c100
commit 137fd3d88a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 109 additions and 14 deletions

View file

@ -6,6 +6,7 @@ import copy
import datetime
from decimal import Decimal as D
from pathlib import Path
import sys
import tempfile
import unittest
@ -91,11 +92,13 @@ class TestMiscellaneous(unittest.TestCase):
self.assertEqual(obj_copy, expected_obj)
def test_inline_array_recursion_limit(self):
nest_count = 470
# 470 with default recursion limit
nest_count = int(sys.getrecursionlimit() * 0.47)
recursive_array_toml = "arr = " + nest_count * "[" + nest_count * "]"
tomllib.loads(recursive_array_toml)
def test_inline_table_recursion_limit(self):
nest_count = 310
# 310 with default recursion limit
nest_count = int(sys.getrecursionlimit() * 0.31)
recursive_table_toml = nest_count * "key = {" + nest_count * "}"
tomllib.loads(recursive_table_toml)