[issue36222] ValueError: a coroutine was expected with asyncio.run

2019-03-07 Thread Rémy Hubscher [:natim]
Rémy Hubscher [:natim] added the comment: Thank you for the clarification :) -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue36222] ValueError: a coroutine was expected with asyncio.run

2019-03-07 Thread STINNER Victor
STINNER Victor added the comment: asyncio.run() requires a coroutine, whereas gather() returns a subclass of asyncio.Future. https://docs.python.org/dev/library/asyncio-task.html#asyncio.run You can wrap gather() into a coroutine like that: --- async def main(): await asyncio.gather(mocke

[issue36222] ValueError: a coroutine was expected with asyncio.run

2019-03-07 Thread Rémy Hubscher [:natim]
New submission from Rémy Hubscher [:natim] : Refs: https://github.com/Martiusweb/asynctest/issues/114 I was trying to mock a `asyncio.run(asyncio.gather())` call and I discovered that while it was working with `loop.run_until_complete` it wasn't with `asyncio.run` Is there a reason for this d