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

Python 3.10: Deprecation warnings regarding event loop #398

Open
tirkarthi opened this issue May 7, 2021 · 0 comments · May be fixed by #402
Open

Python 3.10: Deprecation warnings regarding event loop #398

tirkarthi opened this issue May 7, 2021 · 0 comments · May be fixed by #402

Comments

@tirkarthi
Copy link
Contributor

Related to python/cpython#23554

tests/test_asyncio.py::test_time_freeze_coroutine
  /root/checked_repos/freezegun/tests/test_asyncio.py:17: DeprecationWarning: There is no current event loop
    asyncio.get_event_loop().run_until_complete(frozen_coroutine())

tests/test_asyncio.py::test_time_freeze_async_def
  <string>:5: DeprecationWarning: There is no current event loop

-- Docs: https://docs.pytest.org/en/stable/warnings.html

jktjkt added a commit to jktjkt/freezegun that referenced this issue Oct 16, 2021
Since Python 3.10, the `asyncio.get_event_loop()` has been deprecated in
favor of `asyncio.get_running_loop()`. That one, however, issues a
warning when there's no event loop running (such as in this test suite).

Fix this by always requesting a new event loop. These methods have been
available since at least Python 3.5 (and there are no older docs online
at this point).

Bug: spulec#398
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant