diff Lib/test/test_kqueue.py @ 85420:ef889c3d5dc6

Issue #18571: Implementation of the PEP 446: file descriptors and file handles are now created non-inheritable; add functions os.get/set_inheritable(), os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
author Victor Stinner <victor.stinner@gmail.com>
date Wed, 28 Aug 2013 00:53:59 +0200
parents ccbe2132392b
children
line wrap: on
line diff
--- a/Lib/test/test_kqueue.py	Tue Aug 27 20:17:03 2013 +0300
+++ b/Lib/test/test_kqueue.py	Wed Aug 28 00:53:59 2013 +0200
@@ -206,6 +206,11 @@
         # operations must fail with ValueError("I/O operation on closed ...")
         self.assertRaises(ValueError, kqueue.control, None, 4)
 
+    def test_fd_non_inheritable(self):
+        kqueue = select.kqueue()
+        self.addCleanup(kqueue.close)
+        self.assertEqual(os.get_inheritable(kqueue.fileno()), False)
+
 
 def test_main():
     support.run_unittest(TestKQueue)