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

Prevent DeprecationWarning from reaching user code #779

Merged
merged 1 commit into from Feb 9, 2024

Conversation

seifertm
Copy link
Contributor

@seifertm seifertm commented Feb 9, 2024

Pytest-asyncio still uses asyncio.get_event_loop(). There are plans to move away from it, but get_event_loop is required to maintain compatibility between scoped event loops and loop fixture overrides.

This may lead to instances where the first asyncio test in a test suite emits a DeprecationWarning, which bubbles up to the user's test suite.

This PR silences the warning until pytest-asyncio no longer needs to manipulate the event loop directly.

closes #757

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
@seifertm seifertm added this to the v0.23 milestone Feb 9, 2024
@seifertm seifertm added this pull request to the merge queue Feb 9, 2024
Merged via the queue into pytest-dev:main with commit 4b1908d Feb 9, 2024
14 checks passed
@seifertm seifertm deleted the fix-deprecation-warning branch February 9, 2024 16:27
@seifertm seifertm restored the fix-deprecation-warning branch February 9, 2024 16:32
@seifertm seifertm deleted the fix-deprecation-warning branch February 28, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python 3.11: DeprecationWarning: There is no current event loop
1 participant