prepare tests and disable warnings for asyncio unittest cases

shoehorn unittest async results into python test result interpretation

changelog
This commit is contained in:
Ronny Pfannschmidt
2020-03-14 18:50:43 +01:00
parent ce429381a7
commit 451aef65ac
5 changed files with 48 additions and 4 deletions

View File

@@ -0,0 +1,15 @@
from unittest import IsolatedAsyncioTestCase # type: ignore
class AsyncArguments(IsolatedAsyncioTestCase):
async def test_something_async(self):
async def addition(x, y):
return x + y
self.assertEqual(await addition(2, 2), 4)
async def test_something_async_fails(self):
async def addition(x, y):
return x + y
self.assertEqual(await addition(2, 2), 3)