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

Method do_create

Lib/test/test_tempfile.py:735–753  ·  view source on GitHub ↗
(self, dir=None, pre=None, suf=None)

Source from the content-addressed store, hash-verified

733 return tempfile.mkdtemp()
734
735 def do_create(self, dir=None, pre=None, suf=None):
736 output_type = tempfile._infer_return_type(dir, pre, suf)
737 if dir is None:
738 if output_type is str:
739 dir = tempfile.gettempdir()
740 else:
741 dir = tempfile.gettempdirb()
742 if pre is None:
743 pre = output_type()
744 if suf is None:
745 suf = output_type()
746 name = tempfile.mkdtemp(dir=dir, prefix=pre, suffix=suf)
747
748 try:
749 self.nameCheck(name, dir, pre, suf)
750 return name
751 except:
752 os.rmdir(name)
753 raise
754
755 def test_basic(self):
756 # mkdtemp can create directories

Callers 6

test_basicMethod · 0.95
test_basic_manyMethod · 0.95
test_choose_directoryMethod · 0.95
test_modeMethod · 0.95
test_mode_win32Method · 0.95

Calls 3

mkdtempMethod · 0.80
nameCheckMethod · 0.80
rmdirMethod · 0.80

Tested by

no test coverage detected