|
8 | 8 | from pathlib._abc import UnsupportedOperation, PurePathBase, PathBase |
9 | 9 | import posixpath |
10 | 10 |
|
11 | | -from test.support import set_recursion_limit |
12 | 11 | from test.support.os_helper import TESTFN |
13 | 12 |
|
14 | 13 |
|
@@ -1224,25 +1223,6 @@ def test_rglob_symlink_loop(self): |
1224 | 1223 | } |
1225 | 1224 | self.assertEqual(given, {p / x for x in expect}) |
1226 | 1225 |
|
1227 | | - def test_glob_many_open_files(self): |
1228 | | - depth = 30 |
1229 | | - P = self.cls |
1230 | | - p = base = P(self.base) / 'deep' |
1231 | | - p.mkdir() |
1232 | | - for _ in range(depth): |
1233 | | - p /= 'd' |
1234 | | - p.mkdir() |
1235 | | - pattern = '/'.join(['*'] * depth) |
1236 | | - iters = [base.glob(pattern) for j in range(100)] |
1237 | | - for it in iters: |
1238 | | - self.assertEqual(next(it), p) |
1239 | | - iters = [base.rglob('d') for j in range(100)] |
1240 | | - p = base |
1241 | | - for i in range(depth): |
1242 | | - p = p / 'd' |
1243 | | - for it in iters: |
1244 | | - self.assertEqual(next(it), p) |
1245 | | - |
1246 | 1226 | def test_glob_dotdot(self): |
1247 | 1227 | # ".." is not special in globs. |
1248 | 1228 | P = self.cls |
@@ -1286,17 +1266,6 @@ def test_glob_long_symlink(self): |
1286 | 1266 | bad_link.symlink_to("bad" * 200) |
1287 | 1267 | self.assertEqual(sorted(base.glob('**/*')), [bad_link]) |
1288 | 1268 |
|
1289 | | - def test_glob_above_recursion_limit(self): |
1290 | | - recursion_limit = 50 |
1291 | | - # directory_depth > recursion_limit |
1292 | | - directory_depth = recursion_limit + 10 |
1293 | | - base = self.cls(self.base, 'deep') |
1294 | | - path = base.joinpath(*(['d'] * directory_depth)) |
1295 | | - path.mkdir(parents=True) |
1296 | | - |
1297 | | - with set_recursion_limit(recursion_limit): |
1298 | | - list(base.glob('**/')) |
1299 | | - |
1300 | 1269 | def test_glob_recursive_no_trailing_slash(self): |
1301 | 1270 | P = self.cls |
1302 | 1271 | p = P(self.base) |
@@ -1825,17 +1794,6 @@ def test_walk_symlink_location(self): |
1825 | 1794 | else: |
1826 | 1795 | self.fail("symlink not found") |
1827 | 1796 |
|
1828 | | - def test_walk_above_recursion_limit(self): |
1829 | | - recursion_limit = 40 |
1830 | | - # directory_depth > recursion_limit |
1831 | | - directory_depth = recursion_limit + 10 |
1832 | | - base = self.cls(self.base, 'deep') |
1833 | | - path = base.joinpath(*(['d'] * directory_depth)) |
1834 | | - path.mkdir(parents=True) |
1835 | | - |
1836 | | - with set_recursion_limit(recursion_limit): |
1837 | | - list(base.walk()) |
1838 | | - list(base.walk(top_down=False)) |
1839 | 1797 |
|
1840 | 1798 | class DummyPathWithSymlinks(DummyPath): |
1841 | 1799 | def readlink(self): |
|
0 commit comments