-
Notifications
You must be signed in to change notification settings - Fork 160
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
Configuration option for a custom event loop policy and/or custom event loop class? #20
Comments
I agree being able to test using a different event loop can be useful. I'd argue the approach most in the spirit of pytest would be to override the event_loop fixture. This will make the |
maybe something like fixture factory may be used?
|
Hi, we've already sketched out a solution in #21 and there's an implementation in https://github.com/pytest-dev/pytest-asyncio/tree/feature/pluggable-event-loops. I just need to write the docs before merging it in and doing a release. I'm pretty happy with the results. |
I believe this is fixed in 0.4, open another issue for further discussion if you feel like it. |
Merge transactions branch, still untested in depth, basic tests are passing
It would be useful when testing an application that uses a custom implementation of
asyncio.AbstractEventLoop
to be able to provide a custom event loop policy and/or custom event loop via a configuration option.It is of course already possible to set the event loop policy globally with
asyncio.set_event_loop_policy
(e.g. inpytest_configure
) or to override theevent_loop
fixture so that it returns a loop of the desired class, so perhaps this would be unnecessary.The text was updated successfully, but these errors were encountered: