summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_events.py')
-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).