Remove not used async run() functions from tests

This commit is contained in:
Roman Mogylatov 2021-10-11 20:26:41 -04:00
parent 762d690720
commit 202e99384d
2 changed files with 2 additions and 12 deletions

View File

@ -7,11 +7,6 @@ import gc
import unittest
def run(main):
loop = asyncio.get_event_loop()
return loop.run_until_complete(main)
def setup_test_loop(
loop_factory=asyncio.new_event_loop
) -> asyncio.AbstractEventLoop:

View File

@ -30,11 +30,6 @@ async def _example(arg1, arg2, arg3, arg4):
return arg1, arg2, arg3, arg4
def run(main):
loop = asyncio.get_event_loop()
return loop.run_until_complete(main)
class CoroutineTests(AsyncTestCase):
def test_init_with_coroutine(self):
@ -47,7 +42,7 @@ class CoroutineTests(AsyncTestCase):
provider = providers.Coroutine()
provider.set_provides(_example)
self.assertIs(provider.provides, _example)
self.assertEqual(run(provider(1, 2, 3, 4)), (1, 2, 3, 4))
self.assertEqual(self._run(provider(1, 2, 3, 4)), (1, 2, 3, 4))
def test_set_provides_returns_self(self):
provider = providers.Coroutine()
@ -66,7 +61,7 @@ class CoroutineTests(AsyncTestCase):
provider = providers.Coroutine(_example,
1, 2,
arg3=3, arg4=4)
self.assertTupleEqual(run(provider()), (1, 2, 3, 4))
self.assertTupleEqual(self._run(provider()), (1, 2, 3, 4))
def test_call_with_context_args(self):
provider = providers.Coroutine(_example, 1, 2)