def test_done_task_cancelled(self): t = Task(lambda: None) t() t.cancel() self.assertFalse(t.cancelled())
def test_cancelled(self): t = Task(lambda: None) t.cancel() self.assertTrue(t.cancelled())