simplify test

This commit is contained in:
Victor Shyba 2019-12-11 23:33:34 -03:00 committed by Lex Berezhny
parent 82ef76b1cb
commit a258b96602

View file

@ -1,4 +1,5 @@
import asyncio import asyncio
import unittest
from torba.stream import StreamController from torba.stream import StreamController
from torba.tasks import TaskGroup from torba.tasks import TaskGroup
@ -23,9 +24,8 @@ class StreamControllerTestCase(AsyncioTestCase):
self.assertListEqual(events, ["yo"]) self.assertListEqual(events, ["yo"])
class TaskGroupTestCase(AsyncioTestCase): class TaskGroupTestCase(unittest.TestCase):
async def test_stop_empty_set(self): def test_cancel_sets_it_done(self):
group = TaskGroup() group = TaskGroup()
group.cancel() group.cancel()
await asyncio.wait_for(group.done.wait(), timeout=0.5)
self.assertTrue(group.done.is_set()) self.assertTrue(group.done.is_set())