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

Method testInvalidFd

Lib/test/test_io/test_fileio.py:621–626  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

619 self.assertRaises(ValueError, self.FileIO, bytes(fn_with_NUL, 'ascii'), 'w')
620
621 def testInvalidFd(self):
622 self.assertRaises(ValueError, self.FileIO, -10)
623 self.assertRaises(OSError, self.FileIO, make_bad_fd())
624 if sys.platform == 'win32':
625 import msvcrt
626 self.assertRaises(OSError, msvcrt.get_osfhandle, make_bad_fd())
627
628 def testBooleanFd(self):
629 for fd in False, True:

Callers

nothing calls this directly

Calls 2

make_bad_fdFunction · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected