Message357000
If you are trying to use AsyncMock to mock a coroutine that returns awaitable objects, AsyncMock awaits on those objects instead of returning them as is.
Example:
mock = AsyncMock(return_value=asyncio.Future())
v = await mock() # blocks on trying to await the future
Expected:
mock = AsyncMock(return_value=asyncio.Future())
v = await mock()
assert isisnstance(v, asyncio.Future)
This problem affects side_effects and wraps. |
|
Date |
User |
Action |
Args |
2019-11-19 23:04:14 | fried | set | recipients:
+ fried, lisroach |
2019-11-19 23:04:13 | fried | set | messageid: <1574204653.99.0.272373846707.issue38857@roundup.psfhosted.org> |
2019-11-19 23:04:13 | fried | link | issue38857 messages |
2019-11-19 23:04:13 | fried | create | |
|