diff options
author | Malcolm Smith <smith@chaquo.com> | 2024-03-10 22:00:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-10 22:00:33 (GMT) |
commit | 2339e7cff745271f0e4a919573a347ab2bc1c2e9 (patch) | |
tree | 23041d83abc0614b9c9e4219354a6f669b602477 /Lib/test/test_pathlib/test_pathlib.py | |
parent | c5fa796619a8cae5a1a8a4a043d05a99adec713d (diff) | |
download | cpython-2339e7cff745271f0e4a919573a347ab2bc1c2e9.zip cpython-2339e7cff745271f0e4a919573a347ab2bc1c2e9.tar.gz cpython-2339e7cff745271f0e4a919573a347ab2bc1c2e9.tar.bz2 |
gh-116057: Use relative recursion limits when testing os.walk() and Path.walk() (#116058)
Replace test.support.set_recursion_limit with test.support.infinite_recursion.
Diffstat (limited to 'Lib/test/test_pathlib/test_pathlib.py')
-rw-r--r-- | Lib/test/test_pathlib/test_pathlib.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_pathlib/test_pathlib.py b/Lib/test/test_pathlib/test_pathlib.py index 7e44ae6..6509c08 100644 --- a/Lib/test/test_pathlib/test_pathlib.py +++ b/Lib/test/test_pathlib/test_pathlib.py @@ -15,7 +15,7 @@ from urllib.request import pathname2url from test.support import import_helper from test.support import is_emscripten, is_wasi -from test.support import set_recursion_limit +from test.support import infinite_recursion from test.support import os_helper from test.support.os_helper import TESTFN, FakePath from test.test_pathlib import test_pathlib_abc @@ -1199,7 +1199,7 @@ class PathTest(test_pathlib_abc.DummyPathTest, PurePathTest): path = base.joinpath(*(['d'] * directory_depth)) path.mkdir(parents=True) - with set_recursion_limit(recursion_limit): + with infinite_recursion(recursion_limit): list(base.walk()) list(base.walk(top_down=False)) @@ -1239,7 +1239,7 @@ class PathTest(test_pathlib_abc.DummyPathTest, PurePathTest): path = base.joinpath(*(['d'] * directory_depth)) path.mkdir(parents=True) - with set_recursion_limit(recursion_limit): + with infinite_recursion(recursion_limit): list(base.glob('**/')) def test_glob_pathlike(self): |