diff --git a/README.rst b/README.rst index 9fa74752..e0b81bf4 100644 --- a/README.rst +++ b/README.rst @@ -178,6 +178,8 @@ Changelog - The ``forbid_global_loop`` parameter has been removed. - Support for async and async gen fixtures has been added. `#45 `_ +- The deprecation warning regarding ``asyncio.async()`` has been fixed. + `#51 `_ 0.5.0 (2016-09-07) ~~~~~~~~~~~~~~~~~~ diff --git a/pytest_asyncio/plugin.py b/pytest_asyncio/plugin.py index a83373c2..681cb161 100644 --- a/pytest_asyncio/plugin.py +++ b/pytest_asyncio/plugin.py @@ -152,7 +152,8 @@ def pytest_pyfunc_call(pyfuncitem): for arg in pyfuncitem._fixtureinfo.argnames} event_loop.run_until_complete( - asyncio.async(pyfuncitem.obj(**testargs), loop=event_loop)) + asyncio.ensure_future( + pyfuncitem.obj(**testargs), loop=event_loop)) return True