'asyncgen': agen
})
- def _check_runnung(self):
+ def _check_running(self):
if self.is_running():
raise RuntimeError('This event loop is already running')
if events._get_running_loop() is not None:
def run_forever(self):
"""Run until stop() is called."""
self._check_closed()
- self._check_runnung()
+ self._check_running()
self._set_coroutine_origin_tracking(self._debug)
self._thread_id = threading.get_ident()
Return the Future's result, or raise its exception.
"""
self._check_closed()
- self._check_runnung()
+ self._check_running()
new_task = not futures.isfuture(future)
future = tasks.ensure_future(future, loop=self)
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).