cpython/Lib/test/support
Victor Stinner 95eb9849dd
[3.11] gh-108851: Fix tomllib recursion tests (#108853) (#109013)
gh-108851: Fix tomllib recursion tests (#108853)

* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Change infinite_recursion() default max_depth from 75 to 100.
* Fix test_tomllib recursion tests for WASI buildbots: reduce the
  recursion limit and compute the maximum nested array/dict depending
  on the current available recursion limit.
* test.pythoninfo logs sys.getrecursionlimit().
* Enhance test_sys tests on sys.getrecursionlimit()
  and sys.setrecursionlimit().

Backport notes:

* Set support.infinite_recursion() minimum to 4 frames.
* test_support.test_get_recursion_depth() uses limit-2, apparently
  f-string counts for 2 frames in Python 3.11.
* test_sys.test_setrecursionlimit_to_depth() tests depth+2 instead of
  depth+1.

(cherry picked from commit 8ff1142578)
2023-09-06 16:40:39 +00:00
..
__init__.py [3.11] gh-108851: Fix tomllib recursion tests (#108853) (#109013) 2023-09-06 16:40:39 +00:00
bytecode_helper.py
hashlib_helper.py
import_helper.py
interpreters.py
logging_helper.py
os_helper.py gh-90473: Fix more tests on platforms without umask (GH-95164) 2022-07-23 03:51:29 -07:00
script_helper.py
socket_helper.py Fix broken link to MSDN (GH-102355) 2023-03-13 06:42:30 -07:00
testresult.py
threading_helper.py
warnings_helper.py gh-103109: Document ignore_warnings() test support helper (GH-103110) 2023-04-02 15:42:43 -07:00