summaryrefslogtreecommitdiff
path: root/Lib/test/test_asyncio/test_tasks.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-12-20 04:50:45 -0800
committerGitHub <noreply@github.com>2021-12-20 14:50:45 +0200
commit95948169d75bed3936284ea2225e83e07ec5fe20 (patch)
tree269af5d88a76c674e7768f29644b0f57ca9f46da /Lib/test/test_asyncio/test_tasks.py
parent0c0bd78ccf8e1eb1d8ecfce423daf2a2f8ca6d3b (diff)
downloadcpython-git-95948169d75bed3936284ea2225e83e07ec5fe20.tar.gz
bpo-23819: Get rid of assert statements in test_asyncio (GH-30212) (GH-30213)
To keep checks even if run tests with optimized Python. Either use special assertion methods like assertEqual() or raise an AssertionError explicitly. (cherry picked from commit 6ca78affc8023bc5023189d64d8050857662042a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/test/test_asyncio/test_tasks.py')
-rw-r--r--Lib/test/test_asyncio/test_tasks.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index 773d5057fe..1c05944c42 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -329,7 +329,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):
@@ -1155,7 +1155,7 @@ class BaseTaskTests:
async def main():
result = await asyncio.wait_for(inner(), timeout=.01)
- assert result == 1
+ self.assertEqual(result, 1)
asyncio.run(main())