def test_whenDoneError(self):
        deferred1 = self.task.whenDone()
        results = []
        deferred1.addErrback(results.append)
        self.dieNext()
        self.scheduler.pump()
        self.assertEqual(len(results), 1)
        self.assertEqual(results[0].check(UnhandledException), UnhandledException)
L{CooperativeTask.whenDone} returns a L{defer.Deferred} that will fail
dataset/ETHPy150Open twisted/twisted/twisted/test/test_cooperator.py/RunStateTests.test_whenDoneError