MCPcopy Create free account
hub / github.com/python/cpython / test_walk_prune

Method test_walk_prune

Lib/test/test_pathlib/test_read.py:198–205  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

196 self.assertRaises(StopIteration, next, it)
197
198 def test_walk_prune(self):
199 expected = {self.root, self.root / 'dirA', self.root / 'dirC', self.root / 'dirC' / 'dirD'}
200 actual = set()
201 for path, dirnames, filenames in self.root.walk():
202 actual.add(path)
203 if path == self.root:
204 dirnames.remove('dirB')
205 self.assertEqual(actual, expected)
206
207 def test_walk_bottom_up(self):
208 seen_root = seen_dira = seen_dirb = seen_dirc = seen_dird = False

Callers

nothing calls this directly

Calls 5

setFunction · 0.85
walkMethod · 0.45
addMethod · 0.45
removeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected