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

Method test_fileio_closefd

Lib/test/test_io.py:958–968  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

956 self.assertEqual(cm.exception.errno, errno.EBADF)
957
958 def test_fileio_closefd(self):
959 # Issue #4841
960 with self.open(__file__, 'rb') as f1, \
961 self.open(__file__, 'rb') as f2:
962 fileio = self.FileIO(f1.fileno(), closefd=False)
963 # .__init__() must not close f1
964 fileio.__init__(f2.fileno(), closefd=False)
965 f1.readline()
966 # .close() must not close f2
967 fileio.close()
968 f2.readline()
969
970 def test_nonbuffered_textio(self):
971 with warnings_helper.check_no_resource_warning(self):

Callers

nothing calls this directly

Calls 5

__init__Method · 0.95
closeMethod · 0.95
openMethod · 0.45
filenoMethod · 0.45
readlineMethod · 0.45

Tested by

no test coverage detected