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

Method test_get_inheritable_cloexec

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

Source from the content-addressed store, hash-verified

6609
6610 @unittest.skipIf(fcntl is None, "need fcntl")
6611 def test_get_inheritable_cloexec(self):
6612 sock = socket.socket()
6613 with sock:
6614 fd = sock.fileno()
6615 self.assertEqual(sock.get_inheritable(), False)
6616
6617 # clear FD_CLOEXEC flag
6618 flags = fcntl.fcntl(fd, fcntl.F_GETFD)
6619 flags &= ~fcntl.FD_CLOEXEC
6620 fcntl.fcntl(fd, fcntl.F_SETFD, flags)
6621
6622 self.assertEqual(sock.get_inheritable(), True)
6623
6624 @unittest.skipIf(fcntl is None, "need fcntl")
6625 def test_set_inheritable_cloexec(self):

Callers

nothing calls this directly

Calls 4

socketMethod · 0.80
filenoMethod · 0.45
assertEqualMethod · 0.45
get_inheritableMethod · 0.45

Tested by

no test coverage detected