'Test that reapProcess logs errors raised.'

def test_mockWithWaitError(self):

    self.mockos.child = False
    cmd = '/mock/ouch'
    self.mockos.waitChild = (0, 0)
    d = defer.Deferred()
    p = TrivialProcessProtocol(d)
    proc = reactor.spawnProcess(p, cmd, ['ouch'], env=None, usePTY=False)
    self.assertEqual(self.mockos.actions, [('fork', False), 'waitpid'])
    self.mockos.raiseWaitPid = OSError()
    proc.reapProcess()
    errors = self.flushLoggedErrors()
    self.assertEqual(len(errors), 1)
    errors[0].trap(OSError)
