async def get_task_valid_task(): s = Scheduler() t_id = s.schedule_at(foo, time=datetime(year=2100, month=1, day=1)) s.cancel(t_id) assert len(s._scheduled_tasks) == 0
async def get_task_valid_task(): s = Scheduler() t_id = s.schedule_in(foo, time=1) s.cancel(t_id) assert len(s._scheduled_tasks) == 0
async def get_task_valid_task(): s = Scheduler() s.schedule_in(foo, time=1) with pytest.raises(KeyError): s.cancel(1)
async def get_task_valid_task(): s = Scheduler() t_id = s.schedule_at(foo, time=datetime(year=2100, month=1, day=1)) with pytest.raises(KeyError): s.cancel(1)