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

Method do_create2

Lib/test/test_tempfile.py:1648–1657  ·  view source on GitHub ↗
(self, path, recurse=1, dirs=1, files=1)

Source from the content-addressed store, hash-verified

1646 return tmp
1647
1648 def do_create2(self, path, recurse=1, dirs=1, files=1):
1649 # Create subdirectories and some files
1650 if recurse:
1651 for i in range(dirs):
1652 name = os.path.join(path, "dir%d" % i)
1653 os.mkdir(name)
1654 self.do_create2(name, recurse-1, dirs, files)
1655 for i in range(files):
1656 with open(os.path.join(path, "test%d.txt" % i), "wb") as f:
1657 f.write(b"Hello world!")
1658
1659 def test_mkdtemp_failure(self):
1660 # Check no additional exception if mkdtemp fails

Callers 1

do_createMethod · 0.95

Calls 4

openFunction · 0.50
joinMethod · 0.45
mkdirMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected