'Raise an error during execvpe to check error management.'

def test_executionError(self):

    cmd = self.getCommand('false')
    d = defer.Deferred()
    p = TrivialProcessProtocol(d)
    def buggyexecvpe(command, args, environment):
        raise RuntimeError('Ouch')
    oldexecvpe = os.execvpe
    os.execvpe = buggyexecvpe
    try:
        reactor.spawnProcess(p, cmd, ['false'], env=None, usePTY=self.usePTY)
        def check(ignored):
            errData = ''.join((p.errData + p.outData))
            self.assertIn('Upon    execvpe', errData)
            self.assertIn('Ouch', errData)
        d.addCallback(check)
    finally:
        os.execvpe = oldexecvpe
    return d
