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

Method test_set_inheritable_cloexec

Lib/test/test_os/test_os.py:4482–4490  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4480
4481 @unittest.skipIf(fcntl is None, "need fcntl")
4482 def test_set_inheritable_cloexec(self):
4483 fd = os.open(__file__, os.O_RDONLY)
4484 self.addCleanup(os.close, fd)
4485 self.assertEqual(fcntl.fcntl(fd, fcntl.F_GETFD) & fcntl.FD_CLOEXEC,
4486 fcntl.FD_CLOEXEC)
4487
4488 os.set_inheritable(fd, True)
4489 self.assertEqual(fcntl.fcntl(fd, fcntl.F_GETFD) & fcntl.FD_CLOEXEC,
4490 0)
4491
4492 @unittest.skipUnless(hasattr(os, 'O_PATH'), "need os.O_PATH")
4493 def test_get_set_inheritable_o_path(self):

Callers

nothing calls this directly

Calls 4

addCleanupMethod · 0.80
set_inheritableMethod · 0.80
openMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected