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.
This commit is contained in:
Malcolm Smith 2024-03-10 22:00:33 +00:00 committed by GitHub
parent c5fa796619
commit 2339e7cff7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -34,7 +34,7 @@ from test import support
from test.support import import_helper
from test.support import os_helper
from test.support import socket_helper
from test.support import set_recursion_limit
from test.support import infinite_recursion
from test.support import warnings_helper
from platform import win32_is_iot
@ -1496,7 +1496,7 @@ class WalkTests(unittest.TestCase):
def test_walk_above_recursion_limit(self):
depth = 50
os.makedirs(os.path.join(self.walk_path, *(['d'] * depth)))
with set_recursion_limit(depth - 5):
with infinite_recursion(depth - 5):
all = list(self.walk(self.walk_path))
sub2_path = self.sub2_tree[0]