Closed qstokkink closed 5 months ago
I'll update this issue with a superior suggestion by @egbertbouman. The TaskManager
can support a get_task(task_name: str) -> Future
.
Perhaps we can also add get_anonymous_tasks(base_name: str) -> list[Future]
.
This would change the envisioned functionality to be the following:
async def test_something(self) -> None:
task_manager.user_logic_registers_tasks()
await sleep(0)
await task_manager.get_task("task name")
# assert something ...
While writing tests, I often use the following pattern to await a registered task:
Ideally, I would not like to repeat myself this much. Instead, I'd like
TestBase
to offer this functionality. Something like this: