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

Method do_create

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

Source from the content-addressed store, hash-verified

714 return tempfile.mkdtemp()
715
716 def do_create(self, dir=None, pre=None, suf=None):
717 output_type = tempfile._infer_return_type(dir, pre, suf)
718 if dir is None:
719 if output_type is str:
720 dir = tempfile.gettempdir()
721 else:
722 dir = tempfile.gettempdirb()
723 if pre is None:
724 pre = output_type()
725 if suf is None:
726 suf = output_type()
727 name = tempfile.mkdtemp(dir=dir, prefix=pre, suffix=suf)
728
729 try:
730 self.nameCheck(name, dir, pre, suf)
731 return name
732 except:
733 os.rmdir(name)
734 raise
735
736 def test_basic(self):
737 # 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