This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author fried
Recipients fried, lisroach
Date 2019-11-19.23:04:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1574204653.99.0.272373846707.issue38857@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-11-19 23:04:14friedsetrecipients: + fried, lisroach
2019-11-19 23:04:13friedsetmessageid: <1574204653.99.0.272373846707.issue38857@roundup.psfhosted.org>
2019-11-19 23:04:13friedlinkissue38857 messages
2019-11-19 23:04:13friedcreate