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

Method test_set_inheritable_cloexec

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

Source from the content-addressed store, hash-verified

6623
6624 @unittest.skipIf(fcntl is None, "need fcntl")
6625 def test_set_inheritable_cloexec(self):
6626 sock = socket.socket()
6627 with sock:
6628 fd = sock.fileno()
6629 self.assertEqual(fcntl.fcntl(fd, fcntl.F_GETFD) & fcntl.FD_CLOEXEC,
6630 fcntl.FD_CLOEXEC)
6631
6632 sock.set_inheritable(True)
6633 self.assertEqual(fcntl.fcntl(fd, fcntl.F_GETFD) & fcntl.FD_CLOEXEC,
6634 0)
6635
6636
6637 def test_socketpair(self):

Callers

nothing calls this directly

Calls 4

socketMethod · 0.80
set_inheritableMethod · 0.80
filenoMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected