Open
Description
This issue doesn't propose a specific codebase change but is a point for discussing future steps in the plugin evolution.
Python has deprecated event loop policies since (unreleased) py-3.14.
The main asyncio motion idea for this and related changes is:
- Don't instantiate the loop explicitly, but use
Runner
(introduced in 3.11, there is a backport library for older Python version). - Control runner behavior by
debug
andloop_factory
arguments. - There are eager tasks since 3.12; maybe the runner will have the option to configure it as well if we make an agreement
I think pytest-asyncio should reflect these changes.
event_loop_policy()
fixture should be deprecated along withevent_loop
.- The library should not introduce public fixtures except
unused_tcp_port
and family. It is very fragile, especially if a user starts fixture overriding. - Fine-grained control could be done by special
pytest.mark.asyncio(...)
arguments. - Coarse-grained control uses configfile parameters and, maybe, cmdline args.
- Implementation details could vary; we are free to change them in the wild until the details are not leaked into the public space. The plugin already has a good movement in this direction, so I merely summarized what we do.
Please share your opinions in the comments, guys.
Metadata
Metadata
Assignees
Labels
No labels