MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / test_rmtree_read_only_directories

Function test_rmtree_read_only_directories

tests/util_test.py:100–108  ·  view source on GitHub ↗

Simulates the go module tree. See #1042

(tmpdir)

Source from the content-addressed store, hash-verified

98
99
100def test_rmtree_read_only_directories(tmpdir):
101 """Simulates the go module tree. See #1042"""
102 tmpdir.join('x/y/z').ensure_dir().join('a').ensure()
103 mode = os.stat(str(tmpdir.join('x'))).st_mode
104 mode_no_w = mode & ~(stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH)
105 tmpdir.join('x/y/z').chmod(mode_no_w)
106 tmpdir.join('x/y/z').chmod(mode_no_w)
107 tmpdir.join('x/y/z').chmod(mode_no_w)
108 rmtree(str(tmpdir.join('x')))

Callers

nothing calls this directly

Calls 1

rmtreeFunction · 0.90

Tested by

no test coverage detected