-
-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async_stub doesn't need to be awaited #374
Labels
Comments
Hi @AstraLuma, Can you please replace the async def test_demo(event_loop):
callee = unittest.mock.AsyncMock('callee')
event_loop.call_soon_threadsafe(callee) # Wrong!
await asyncio.sleep(0)
assert callee.called == 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(
event_loop
from pytest-asyncio)Expected behavior:
callee.called
should be zeroActual behavior:
callee.called
is one, and a warning is produced:I'm calling this behavior incorrect (or at least unhelpful) because if I were to use a real coroutine instead of
async_stub()
, the body never would have executed.The text was updated successfully, but these errors were encountered: