aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_task_runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_task_runner.py')
-rw-r--r--tests/test_task_runner.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_task_runner.py b/tests/test_task_runner.py
index 095b013..33b74a6 100644
--- a/tests/test_task_runner.py
+++ b/tests/test_task_runner.py
@@ -61,3 +61,19 @@ def test_run_two_tasks_concurrently():
assert not shared.active_futures
assert task1.result == ("awaitable", ("data1",))
assert task2.result == ("awaitable", ("data2",))
+
+
+def test_task_without_await():
+ shared.active_tasks = defaultdict(list)
+ shared.active_futures = {}
+
+ async def fun_without_await():
+ pass
+
+ async def run():
+ await create_task(fun_without_await())
+
+ create_task(run())
+
+ assert not shared.active_tasks
+ assert not shared.active_futures