aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2020-07-06Scheduler: assert the coroutine hasn't been awaited yetGravatar MarkKoz-0/+3
It'd fail to schedule the coroutine otherwise anyway. There is also the potential to close the coroutine, which may be unexpected to see for a coroutine that was already running (despite being documented).
2020-06-30Scheduler: more verbose logging in _await_laterGravatar MarkKoz-7/+10
Showing the task ID in the logs makes them distinguishable from logs for other tasks. The coroutine state is logged because it may come in handy while debugging; the coroutine inspection check hasn't been proven yet in production.
2020-06-29Scheduler: explain the name param in the docstringGravatar MarkKoz-0/+4
2020-06-29Scheduler: add details to class docstringGravatar MarkKoz-1/+11
2020-06-25Scheduler: only close unawaited coroutinesGravatar MarkKoz-2/+6
The coroutine may cancel the scheduled task, which would also trigger the finally block. The coroutine isn't necessarily finished when it cancels the task, so it shouldn't be closed in this case.
2020-06-24Scheduler: remove duplicate dict deleteGravatar MarkKoz-1/+0
The task is already popped from the dict, so there is no need to delete it afterwards.
2020-06-23Scheduler: close coroutine if task ID already existsGravatar MarkKoz-1/+7
This prevents unawaited coroutine warnings.
2020-06-20Update InfractionScheduler's scheduler to the new APIGravatar MarkKoz-17/+12
2020-06-20Update HelpChannels's scheduler to the new APIGravatar MarkKoz-50/+20
2020-06-20Update Silence's scheduler to the new APIGravatar MarkKoz-26/+6
2020-06-20Update Reminders's scheduler to the new APIGravatar MarkKoz-14/+15
2020-06-20Update Filtering's scheduler to the new APIGravatar MarkKoz-10/+6
2020-06-20Scheduler: add a method to schedule at a specific datetimeGravatar MarkKoz-0/+13
2020-06-20Scheduler: add a method to schedule with a delayGravatar MarkKoz-0/+19
2020-06-20Scheduler: rename "task" param to "coroutine"Gravatar MarkKoz-3/+3
Naming it "task" is inaccurate because `create_task` accepts a coroutine rather than a Task. What it does is wrap the coroutine in a Task.
2020-06-20Scheduler: drop _task suffix from method namesGravatar MarkKoz-3/+3
It's redundant. After all, this scheduler cannot schedule anything else.
2020-06-20Scheduler: remove ignore_missing paramGravatar MarkKoz-10/+5
The ability to use the `in` operator makes this obsolete. Callers can check themselves if a task exists before they try to cancel it.
2020-06-19Scheduler: use pop instead of get when cancellingGravatar MarkKoz-7/+7
2020-06-19Scheduler: add support for in operatorGravatar MarkKoz-0/+4
2020-06-19Scheduler: name tasksGravatar MarkKoz-1/+1
Makes them easier to identify when debugging.
2020-06-19Scheduler: directly take the awaitable to scheduleGravatar MarkKoz-23/+4
This is a major change which simplifies the interface. It removes the need to implement an abstract method, which means the class can now be instantiated rather than subclassed.
2020-06-19Scheduler: use separate logger for each instanceGravatar MarkKoz-24/+17
Each instance now requires a name to be specified, which will be used as the suffix of the logger's name. This removes the need to manually prepend every log message with the name.