forked from LBRYCommunity/lbry-sdk
TaskGroup cannot work without even loop
This commit is contained in:
parent
a258b96602
commit
c1e2c415c4
1 changed files with 3 additions and 5 deletions
|
@ -1,6 +1,3 @@
|
||||||
import asyncio
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
from torba.stream import StreamController
|
from torba.stream import StreamController
|
||||||
from torba.tasks import TaskGroup
|
from torba.tasks import TaskGroup
|
||||||
from torba.testcase import AsyncioTestCase
|
from torba.testcase import AsyncioTestCase
|
||||||
|
@ -24,8 +21,9 @@ class StreamControllerTestCase(AsyncioTestCase):
|
||||||
self.assertListEqual(events, ["yo"])
|
self.assertListEqual(events, ["yo"])
|
||||||
|
|
||||||
|
|
||||||
class TaskGroupTestCase(unittest.TestCase):
|
class TaskGroupTestCase(AsyncioTestCase):
|
||||||
def test_cancel_sets_it_done(self):
|
|
||||||
|
async def test_cancel_sets_it_done(self):
|
||||||
group = TaskGroup()
|
group = TaskGroup()
|
||||||
group.cancel()
|
group.cancel()
|
||||||
self.assertTrue(group.done.is_set())
|
self.assertTrue(group.done.is_set())
|
||||||
|
|
Loading…
Add table
Reference in a new issue