MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_walk_bad_dir

Method test_walk_bad_dir

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

Source from the content-addressed store, hash-verified

3540 os_helper.rmtree(self.base)
3541
3542 def test_walk_bad_dir(self):
3543 errors = []
3544 walk_it = self.walk_path.walk(on_error=errors.append)
3545 root, dirs, files = next(walk_it)
3546 self.assertEqual(errors, [])
3547 dir1 = 'SUB1'
3548 path1 = root / dir1
3549 path1new = (root / dir1).with_suffix(".new")
3550 path1.rename(path1new)
3551 try:
3552 roots = [r for r, _, _ in walk_it]
3553 self.assertTrue(errors)
3554 self.assertNotIn(path1, roots)
3555 self.assertNotIn(path1new, roots)
3556 for dir2 in dirs:
3557 if dir2 != dir1:
3558 self.assertIn(root / dir2, roots)
3559 finally:
3560 path1new.rename(path1)
3561
3562 def test_walk_many_open_files(self):
3563 depth = 30

Callers

nothing calls this directly

Calls 8

nextFunction · 0.85
assertTrueMethod · 0.80
assertNotInMethod · 0.80
assertInMethod · 0.80
walkMethod · 0.45
assertEqualMethod · 0.45
with_suffixMethod · 0.45
renameMethod · 0.45

Tested by

no test coverage detected