mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
bpo-23819: Get rid of assert statements in test_asyncio (GH-30212)
To keep checks even if run tests with optimized Python. Either use special assertion methods like assertEqual() or raise an AssertionError explicitly.
This commit is contained in:
parent
7c5c3f7254
commit
6ca78affc8
10 changed files with 102 additions and 63 deletions
|
|
@ -278,7 +278,7 @@ class BaseTaskTests:
|
|||
self.set_event_loop(loop)
|
||||
fut = asyncio.ensure_future(Aw(coro()), loop=loop)
|
||||
loop.run_until_complete(fut)
|
||||
assert fut.result() == 'ok'
|
||||
self.assertEqual(fut.result(), 'ok')
|
||||
|
||||
def test_ensure_future_neither(self):
|
||||
with self.assertRaises(TypeError):
|
||||
|
|
@ -1016,7 +1016,7 @@ class BaseTaskTests:
|
|||
|
||||
async def main():
|
||||
result = await asyncio.wait_for(inner(), timeout=.01)
|
||||
assert result == 1
|
||||
self.assertEqual(result, 1)
|
||||
|
||||
asyncio.run(main())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue