MCPcopy Index your code
hub / github.com/python/cpython / test_glob_many_open_files

Method test_glob_many_open_files

Lib/test/test_pathlib/test_pathlib.py:2874–2891  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2872 list(p.glob('./'))
2873
2874 def test_glob_many_open_files(self):
2875 depth = 30
2876 P = self.cls
2877 p = base = P(self.base) / 'deep'
2878 p.mkdir()
2879 for _ in range(depth):
2880 p /= 'd'
2881 p.mkdir()
2882 pattern = '/'.join(['*'] * depth)
2883 iters = [base.glob(pattern) for j in range(100)]
2884 for it in iters:
2885 self.assertEqual(next(it), p)
2886 iters = [base.rglob('d') for j in range(100)]
2887 p = base
2888 for i in range(depth):
2889 p = p / 'd'
2890 for it in iters:
2891 self.assertEqual(next(it), p)
2892
2893 def test_glob_above_recursion_limit(self):
2894 recursion_limit = 50

Callers

nothing calls this directly

Calls 6

PClass · 0.70
mkdirMethod · 0.45
joinMethod · 0.45
globMethod · 0.45
assertEqualMethod · 0.45
rglobMethod · 0.45

Tested by

no test coverage detected