def test_whenDoneStop(self):
        deferred1 = self.task.whenDone()
        errors = []
        deferred1.addErrback(errors.append)
        self.task.stop()
        self.assertEqual(len(errors), 1)
        self.assertEqual(errors[0].check(task.TaskStopped), task.TaskStopped)
L{CooperativeTask.whenDone} returns a L{defer.Deferred} that fails with
dataset/ETHPy150Open twisted/twisted/twisted/test/test_cooperator.py/RunStateTests.test_whenDoneStop