MCPcopy Create free account
hub / github.com/ipython/ipython / make_tempfile

Function make_tempfile

IPython/testing/tools.py:422–429  ·  view source on GitHub ↗

Create an empty, named, temporary file for the duration of the context.

(name)

Source from the content-addressed store, hash-verified

420
421@contextmanager
422def make_tempfile(name):
423 """ Create an empty, named, temporary file for the duration of the context.
424 """
425 open(name, 'w').close()
426 try:
427 yield
428 finally:
429 os.unlink(name)
430
431def fake_input(inputs):
432 """Temporarily replace the input() function to return the given values

Callers 1

test_get_py_filenameFunction · 0.90

Calls 1

closeMethod · 0.45

Tested by 1

test_get_py_filenameFunction · 0.72