Skip to content
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

Clarify docs about requesting the event_loop fixture #964

Open
tuukkamustonen opened this issue Oct 16, 2024 · 1 comment
Open

Clarify docs about requesting the event_loop fixture #964

tuukkamustonen opened this issue Oct 16, 2024 · 1 comment

Comments

@tuukkamustonen
Copy link

https://pytest-asyncio.readthedocs.io/en/latest/reference/fixtures/index.html#event-loop suggests that it's fine to grab event_loop fixture in a non-async function.

0.21+ migration guide in https://pytest-asyncio.readthedocs.io/en/latest/how-to-guides/migrate_from_0_21.html suggests to convert all sync functions requesting the event_loop fixture into async functions, and then acquire the loop via asyncio.get_running_loop().

Which one is it, and what is the rationale of not depending on the event_loop fixture directly?

@seifertm seifertm added this to the v0.24 milestone Oct 24, 2024
@seifertm
Copy link
Contributor

The use of event_loop is deprecated. We should adjust the docs to reflect that.
The rationale is summarized here:
#706 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants