summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2020-01-07 13:23:01 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-01-07 13:23:01 (GMT)
commit10ac0cded26d91c3468e5e5a87cecad7fc0bcebd (patch)
tree8adf1c1be164e312c31d927105c60d04ca69a094 /Lib/test/test_asyncio
parentca94677a6216e2d41b04574986ce49d31a0b329c (diff)
downloadcpython-10ac0cded26d91c3468e5e5a87cecad7fc0bcebd.zip
cpython-10ac0cded26d91c3468e5e5a87cecad7fc0bcebd.tar.gz
cpython-10ac0cded26d91c3468e5e5a87cecad7fc0bcebd.tar.bz2
bpo-39191: Fix RuntimeWarning in asyncio test (GH-17863)
https://bugs.python.org/issue39191
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_events.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index 4cbd1ed..4bdf82e 100644
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -259,8 +259,12 @@ class EventLoopTestsMixin:
self.assertTrue(self.loop.is_running())
self.loop.run_until_complete(coro1())
- self.assertRaises(
- RuntimeError, self.loop.run_until_complete, coro2())
+ with self.assertWarnsRegex(
+ RuntimeWarning,
+ r"coroutine \S+ was never awaited"
+ ):
+ self.assertRaises(
+ RuntimeError, self.loop.run_until_complete, coro2())
# Note: because of the default Windows timing granularity of
# 15.6 msec, we use fairly long sleep times here (~100 msec).