pytest-dev / pytest-dev/pytest-asyncio
API for loop configuration options
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 207
- Avg merge
- 5h 35m
- Merged PRs (30d)
- 9
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
debugandloop_factoryarguments. - 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_portand 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the event_loop_policy() and event_loop fixtures, pytest.mark.asyncio arguments, and configuration or command-line behavior described in the issue. The issue is a discussion of future API direction rather than a defined implementation. Done would require agreement on the public configuration design and the resulting implementation scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100