freezegun icon indicating copy to clipboard operation
freezegun copied to clipboard

tests: asyncio: Fix Python 3.10 compatibility

Open jktjkt opened this issue 3 years ago • 0 comments

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: https://github.com/spulec/freezegun/issues/398

jktjkt avatar Oct 16 '21 16:10 jktjkt