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

Method test_rmtree_dont_delete_file

Lib/test/test_shutil.py:630–635  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

628 self.assertTrue(os.path.exists(tmp_dir))
629
630 def test_rmtree_dont_delete_file(self):
631 # When called on a file instead of a directory, don't delete it.
632 handle, path = tempfile.mkstemp(dir=self.mkdtemp())
633 os.close(handle)
634 self.assertRaises(NotADirectoryError, shutil.rmtree, path)
635 os.remove(path)
636
637 @os_helper.skip_unless_symlink
638 def test_rmtree_on_symlink(self):

Callers

nothing calls this directly

Calls 4

mkdtempMethod · 0.80
closeMethod · 0.45
assertRaisesMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected