def waitpid(self, pid, options):
        """
        Override C{os.waitpid}. Return values meaning that the child process
        has exited, save executed action.
        """
        self.actions.append('waitpid')
        if self.raiseWaitPid is not None:
            raise self.raiseWaitPid
        if self.waitChild is not None:
            return self.waitChild
        return 1, 0

        Override C{os.waitpid}. Return values meaning that the child process
        has exited, save executed action.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_process.py