-
Notifications
You must be signed in to change notification settings - Fork 32
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 callback are not supported #38
Comments
Hello @mkotsalainen , The callback is not supposed to be async. Best Regards |
Ok I see. I had test where I was concurrently doing some things via async.gather. One of them was a httpx call. My plan was to use asyncio.sleep in the mock response function. I could probably work around it by using normal sleep there instead. Thanks for a great util! |
Sure, if the non-async way does not fit your use case do not hesitate to ask for a feature. Thanks for the nice word :) |
Hello @mkotsalainen, Release 0.21.1 is now available on pypi and allows you to register async callbacks. |
When I register an async function as a callback to httpx_mock I get this error:
TypeError: cannot unpack non-iterable coroutine object
I suppose it's not awaited here:
https://github.com/Colin-b/pytest_httpx/blob/develop/pytest_httpx/_httpx_mock.py#L179
Is this a bug or am I using the library wrong?
Thanks!
The text was updated successfully, but these errors were encountered: