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

Method test_get_set_inheritable

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

Source from the content-addressed store, hash-verified

4458@support.requires_subprocess()
4459class FDInheritanceTests(unittest.TestCase):
4460 def test_get_set_inheritable(self):
4461 fd = os.open(__file__, os.O_RDONLY)
4462 self.addCleanup(os.close, fd)
4463 self.assertEqual(os.get_inheritable(fd), False)
4464
4465 os.set_inheritable(fd, True)
4466 self.assertEqual(os.get_inheritable(fd), True)
4467
4468 @unittest.skipIf(fcntl is None, "need fcntl")
4469 def test_get_inheritable_cloexec(self):

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected