summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tomllib
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2022-05-19 10:43:16 (GMT)
committerGitHub <noreply@github.com>2022-05-19 10:43:16 (GMT)
commit137fd3d88aa46669f5717734e823f4c594ab2843 (patch)
treea527865e1f3729ef3d7c69a43d08072d8d837d9c /Lib/test/test_tomllib
parente48ac9c1003c3816198cbfb6132a995150f9b048 (diff)
downloadcpython-137fd3d88aa46669f5717734e823f4c594ab2843.zip
cpython-137fd3d88aa46669f5717734e823f4c594ab2843.tar.gz
cpython-137fd3d88aa46669f5717734e823f4c594ab2843.tar.bz2
gh-90473: Decrease recursion limit and skip tests on WASI (GH-92803)
Diffstat (limited to 'Lib/test/test_tomllib')
-rw-r--r--Lib/test/test_tomllib/test_misc.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_tomllib/test_misc.py b/Lib/test/test_tomllib/test_misc.py
index 76fa590..378db58 100644
--- a/Lib/test/test_tomllib/test_misc.py
+++ b/Lib/test/test_tomllib/test_misc.py
@@ -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)