def _mockWithForkError(self):
        """
        Assert that if the fork call fails, no other process setup calls are
        made and that spawnProcess raises the exception fork raised.
        """
        self.mockos.raiseFork = OSError(errno.EAGAIN, None)
        protocol = TrivialProcessProtocol(None)
        self.assertRaises(OSError, reactor.spawnProcess, protocol, None)
        self.assertEqual(self.mockos.actions, [("fork", False)])

        Assert that if the fork call fails, no other process setup calls are
        made and that spawnProcess raises the exception fork raised.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_process.py