You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, it is not possible to use MagicMock with asynchronous context managers without spec, because aenter, aexit aren't mocked with CoroutineMock by default.
>>> from asynctest import MagicMock
>>> from asyncio import get_event_loop
>>>
>>> async def f():
... async with MagicMock():
... print('f()')
...
>>> get_event_loop().run_until_complete(f())
TypeError: object MagicMock can't be used in 'await' expression
The text was updated successfully, but these errors were encountered:
Currently, it is not possible to use MagicMock with asynchronous context managers without spec, because aenter, aexit aren't mocked with CoroutineMock by default.
The text was updated successfully, but these errors were encountered: