MCPcopy Index your code
hub / github.com/ipython/ipython / make_tempfile

Function make_tempfile

IPython/testing/tools.py:388–394  ·  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

386
387@contextmanager
388def make_tempfile(name):
389 """Create an empty, named, temporary file for the duration of the context."""
390 open(name, "w", encoding="utf-8").close()
391 try:
392 yield
393 finally:
394 os.unlink(name)
395
396def fake_input(inputs):
397 """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

Used in the wild real call sites across dependent graphs

searching dependent graphs…