From c1e2c415c445a42aa9a40b8fd4ed82ba46d3e6a4 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Wed, 11 Dec 2019 22:10:39 -0500 Subject: [PATCH] TaskGroup cannot work without even loop --- torba/tests/client_tests/unit/test_stream_controller.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/torba/tests/client_tests/unit/test_stream_controller.py b/torba/tests/client_tests/unit/test_stream_controller.py index 2d33f698a..496975536 100644 --- a/torba/tests/client_tests/unit/test_stream_controller.py +++ b/torba/tests/client_tests/unit/test_stream_controller.py @@ -1,6 +1,3 @@ -import asyncio -import unittest - from torba.stream import StreamController from torba.tasks import TaskGroup from torba.testcase import AsyncioTestCase @@ -24,8 +21,9 @@ class StreamControllerTestCase(AsyncioTestCase): self.assertListEqual(events, ["yo"]) -class TaskGroupTestCase(unittest.TestCase): - def test_cancel_sets_it_done(self): +class TaskGroupTestCase(AsyncioTestCase): + + async def test_cancel_sets_it_done(self): group = TaskGroup() group.cancel() self.assertTrue(group.done.is_set())