def test_open_non_inheritable(self): fileobj = open(__file__) with fileobj: self.assertFalse(os.get_inheritable(fileobj.fileno()))