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

Method do_create

Lib/test/test_tempfile.py:403–417  ·  view source on GitHub ↗
(self, dir=None, pre=None, suf=None, bin=1)

Source from the content-addressed store, hash-verified

401 self._unlink(self.name)
402
403 def do_create(self, dir=None, pre=None, suf=None, bin=1):
404 output_type = tempfile._infer_return_type(dir, pre, suf)
405 if dir is None:
406 if output_type is str:
407 dir = tempfile.gettempdir()
408 else:
409 dir = tempfile.gettempdirb()
410 if pre is None:
411 pre = output_type()
412 if suf is None:
413 suf = output_type()
414 file = self.mkstemped(dir, pre, suf, bin)
415
416 self.nameCheck(file.name, dir, pre, suf)
417 return file
418
419 def test_basic(self):
420 # _mkstemp_inner can create files

Callers 7

test_basicMethod · 0.95
test_basic_manyMethod · 0.95
test_choose_directoryMethod · 0.95
test_file_modeMethod · 0.95
test_noinheritMethod · 0.95
test_textmodeMethod · 0.95

Calls 1

nameCheckMethod · 0.80

Tested by

no test coverage detected