def test_mockForkErrorCloseFDs(self):
        """
        When C{os.fork} raises an exception, the file descriptors created
        before are closed and don't leak.
        """
        self._mockWithForkError()
        self.assertEqual(set(self.mockos.closed),
                         set([-1, -4, -6, -2, -3, -5]))

        When C{os.fork} raises an exception, the file descriptors created
        before are closed and don't leak.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_process.py