We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1709020 commit f8a7910Copy full SHA for f8a7910
Lib/test/test_asyncio/test_subprocess.py
@@ -975,8 +975,13 @@ async def in_thread():
975
976
async def main():
977
# asyncio.Runner did not call asyncio.set_event_loop()
978
- with self.assertRaises(RuntimeError):
979
- asyncio.get_event_loop_policy().get_event_loop()
+ with warnings.catch_warnings():
+ warnings.simplefilter('error', DeprecationWarning)
980
+ # get_event_loop() raises DeprecationWarning if
981
+ # set_event_loop() was never called and RuntimeError if
982
+ # it was called at least once.
983
+ with self.assertRaises((RuntimeError, DeprecationWarning)):
984
+ asyncio.get_event_loop_policy().get_event_loop()
985
return await asyncio.to_thread(asyncio.run, in_thread())
986
with self.assertWarns(DeprecationWarning):
987
asyncio.set_child_watcher(asyncio.PidfdChildWatcher())
0 commit comments