MCPcopy Create free account
hub / github.com/python/cpython / test_bad_fd

Method test_bad_fd

Lib/test/test_fcntl.py:281–289  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

279
280 @unittest.skipUnless(hasattr(fcntl, 'F_DUPFD'), 'need fcntl.F_DUPFD')
281 def test_bad_fd(self):
282 # gh-134744: Test error handling
283 fd = make_bad_fd()
284 with self.assertRaises(OSError):
285 fcntl.fcntl(fd, fcntl.F_DUPFD, 0)
286 with self.assertRaises(OSError):
287 fcntl.fcntl(fd, fcntl.F_DUPFD, b'\0' * 10)
288 with self.assertRaises(OSError):
289 fcntl.fcntl(fd, fcntl.F_DUPFD, b'\0' * 2048)
290
291
292if __name__ == '__main__':

Callers

nothing calls this directly

Calls 2

make_bad_fdFunction · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected