Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid warning when running FreezeGun tests on Python 3.10+
To avoid this warning: freezegun/tests/test_asyncio.py:12: DeprecationWarning: There is no current event loop asyncio.get_event_loop().run_until_complete(frozen_coroutine()) on Python 3.10+, we modify tests to use `asyncio.run` instead of `asyncio.get_event_loop().run_until_complete`, which [1] recommends: asyncio.get_event_loop() (...) Consider also using the asyncio.run() function instead of using lower level functions to manually create and close an event loop. Deprecated since version 3.10: Deprecation warning is emitted if there is no running event loop. In future Python releases, this function will be an alias of get_running_loop(). `asyncio.run` has been added in Python 3.7 but we no longer support 3.6 (see spulec#455) so we can use it. [1] https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.get_event_loop
- Loading branch information