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

Manage uvloop's loops & policies properly in tests #1028

Merged
merged 1 commit into from
May 6, 2023

Conversation

nolar
Copy link
Owner

@nolar nolar commented May 6, 2023

Otherwise, pytest-asyncio complains with deprecation warnings (only with uvloop!):

E               DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop
E               fixture: <uvloop.Loop running=False closed=False debug=False>
E               pytest-asyncio will close the event loop for you, but future versions of the
E               library will no longer do so. In order to ensure compatibility with future
E               versions, please make sure that:
E                   1. Any custom "event_loop" fixture properly closes the loop after yielding it
E                   2. Your code does not modify the event loop in async fixtures or tests

…/python3.11/site-packages/pytest_asyncio/plugin.py:444: DeprecationWarning

This makes no difference for the real CLI usage as it is usually used only once and then the process is closed.

Related: #998.

Otherwise, pytest-asyncio complains with deprecation warnings (only with uvloop!):

```
E               DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop
E               fixture: <uvloop.Loop running=False closed=False debug=False>
E               pytest-asyncio will close the event loop for you, but future versions of the
E               library will no longer do so. In order to ensure compatibility with future
E               versions, please make sure that:
E                   1. Any custom "event_loop" fixture properly closes the loop after yielding it
E                   2. Your code does not modify the event loop in async fixtures or tests

…/python3.11/site-packages/pytest_asyncio/plugin.py:444: DeprecationWarning
```

This makes no difference for the real CLI usage as it is usually used only once and then the process is closed.

Signed-off-by: Sergey Vasilyev <[email protected]>
@nolar nolar added bug Something isn't working automation CI/CD: testing, linting, releasing automatically labels May 6, 2023
@nolar nolar merged commit 0692ff0 into main May 6, 2023
@nolar nolar deleted the manage-uvloop-in-tests branch May 6, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation CI/CD: testing, linting, releasing automatically bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant