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

Method clear_directory

Lib/test/test_venv.py:400–406  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

398 self.assertFalse(os.path.exists(fn))
399
400 def clear_directory(self, path):
401 for fn in os.listdir(path):
402 fn = os.path.join(path, fn)
403 if os.path.islink(fn) or os.path.isfile(fn):
404 os.remove(fn)
405 elif os.path.isdir(fn):
406 rmtree(fn)
407
408 def test_unoverwritable_fails(self):
409 #create a file clashing with directories in the env dir

Callers 1

Calls 7

rmtreeFunction · 0.90
listdirMethod · 0.80
islinkMethod · 0.80
joinMethod · 0.45
isfileMethod · 0.45
removeMethod · 0.45
isdirMethod · 0.45

Tested by

no test coverage detected