TaskGroup cannot work without even loop

This commit is contained in:
Lex Berezhny 2019-12-11 22:10:39 -05:00
parent a258b96602
commit c1e2c415c4

View file

@ -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())