prepare tests and disable warnings for asyncio unittest cases
shoehorn unittest async results into python test result interpretation changelog
This commit is contained in:
15
testing/example_scripts/unittest/test_unittest_asyncio.py
Normal file
15
testing/example_scripts/unittest/test_unittest_asyncio.py
Normal 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)
|
||||
Reference in New Issue
Block a user