'The post-case cleanup method will return False and call C{addError} on
the result with a L{DirtyReactorAggregateError} Failure if there are
pending calls.'

def test_postCaseCleanupWithErrors(self):

    delayedCall = DelayedCall(300, (lambda : None), (), {}, (lambda x: None), (lambda x: None), seconds=(lambda : 0))
    delayedCallString = str(delayedCall)
    reactor = StubReactor([delayedCall], [])
    test = object()
    reporter = StubErrorReporter()
    jan = _Janitor(test, reporter, reactor=reactor)
    self.assertFalse(jan.postCaseCleanup())
    self.assertEqual(len(reporter.errors), 1)
    self.assertEqual(reporter.errors[0][1].value.delayedCalls, [delayedCallString])
