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

Method make_file

Lib/test/test_tempfile.py:1003–1007  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1001 # it alive as long as it's being iterated over
1002 lines = [b'spam\n', b'eggs\n', b'beans\n']
1003 def make_file():
1004 f = tempfile.NamedTemporaryFile(mode='w+b')
1005 f.write(b''.join(lines))
1006 f.seek(0)
1007 return f
1008 for i, l in enumerate(make_file()):
1009 self.assertEqual(l, lines[i])
1010 self.assertEqual(i, len(lines) - 1)

Callers

nothing calls this directly

Calls 3

writeMethod · 0.45
joinMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected