def test_mockForkTTY(self):
        """
        Test a TTY spawnProcess: check the path of the client code:
        fork, exec, exit.
        """
        cmd = b'/mock/ouch'

        d = defer.Deferred()
        p = TrivialProcessProtocol(d)
        self.assertRaises(SystemError, reactor.spawnProcess, p, cmd, [b'ouch'],
                          env=None, usePTY=True)
        self.assertTrue(self.mockos.exited)
        self.assertEqual(
            self.mockos.actions,
            [("fork", False), "setsid", "exec", ("exit", 1)])

        Test a TTY spawnProcess: check the path of the client code:
        fork, exec, exit.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_process.py