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

Method test_fileio_closefd

Lib/test/test_io/test_general.py:675–685  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

673 self.assertEqual(cm.exception.errno, errno.EBADF)
674
675 def test_fileio_closefd(self):
676 # Issue #4841
677 with self.open(__file__, 'rb') as f1, \
678 self.open(__file__, 'rb') as f2:
679 fileio = self.FileIO(f1.fileno(), closefd=False)
680 # .__init__() must not close f1
681 fileio.__init__(f2.fileno(), closefd=False)
682 f1.readline()
683 # .close() must not close f2
684 fileio.close()
685 f2.readline()
686
687 def test_nonbuffered_textio(self):
688 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