Skip to content

Commit 1842093

Browse files
morambrocopybara-github
authored andcommitted
Use a larger number of recursions in JwtFormatTest
Using 2000 currently fails on Windows. This is the same value as in https://github.com/python/cpython/blob/v3.12.3/Lib/test/support/__init__.py#L2367. PiperOrigin-RevId: 629343279 Change-Id: If358f3636eb9789cd4e51f271c8a69056f647b6c
1 parent 26b93a4 commit 1842093

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tink/jwt/_json_util_test.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ def test_json_loads_duplidate_entries_fails(self):
3838
_json_util.json_loads('{"a":"a1", "a":"a2"}')
3939

4040
def test_json_loads_recursion(self):
41-
# NOTE: Python 3.12 has raised the maximum C recursion limit to 1500 [1].
42-
#
43-
# [1] https://github.com/python/cpython/pull/107618
44-
num_recursions = 2000
41+
# Value from
42+
# https://github.com/python/cpython/blob/v3.12.3/Lib/test/support/__init__.py#L2367.
43+
num_recursions = 5000
4544
recursive_json = ('{"a":' * num_recursions) + '""' + ('}' * num_recursions)
4645
with self.assertRaises(_jwt_error.JwtInvalidError):
4746
_json_util.json_loads(recursive_json)

0 commit comments

Comments
 (0)