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

Method test_setblocking_invalidfd

Lib/test/test_socket.py:6217–6227  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6215 self.assertIs(socket.timeout, TimeoutError)
6216
6217 def test_setblocking_invalidfd(self):
6218 # Regression test for issue #28471
6219
6220 sock0 = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
6221 sock = socket.socket(
6222 socket.AF_INET, socket.SOCK_STREAM, 0, sock0.fileno())
6223 sock0.close()
6224 self.addCleanup(sock.detach)
6225
6226 with self.assertRaises(OSError):
6227 sock.setblocking(False)
6228
6229
6230@unittest.skipUnless(sys.platform in ('linux', 'android'), 'Linux specific test')

Callers

nothing calls this directly

Calls 6

socketMethod · 0.80
addCleanupMethod · 0.80
filenoMethod · 0.45
closeMethod · 0.45
assertRaisesMethod · 0.45
setblockingMethod · 0.45

Tested by

no test coverage detected