mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-94597: Add asyncio.EventLoop (#110723)
This is needed to pave the way for deprecating and eventually killing the event loop policy system (which is over-engineered and rarely used).
This commit is contained in:
parent
1e3460d9fa
commit
8c6c14b91b
6 changed files with 30 additions and 5 deletions
|
@ -3,6 +3,7 @@ import asyncio
|
|||
import contextvars
|
||||
import re
|
||||
import signal
|
||||
import sys
|
||||
import threading
|
||||
import unittest
|
||||
from test.test_asyncio import utils as test_utils
|
||||
|
@ -272,6 +273,16 @@ class RunTests(BaseTest):
|
|||
asyncio.run(main(), loop_factory=factory)
|
||||
factory.assert_called_once_with()
|
||||
|
||||
def test_loop_factory_default_event_loop(self):
|
||||
async def main():
|
||||
if sys.platform == "win32":
|
||||
self.assertIsInstance(asyncio.get_running_loop(), asyncio.ProactorEventLoop)
|
||||
else:
|
||||
self.assertIsInstance(asyncio.get_running_loop(), asyncio.SelectorEventLoop)
|
||||
|
||||
|
||||
asyncio.run(main(), loop_factory=asyncio.EventLoop)
|
||||
|
||||
|
||||
class RunnerTests(BaseTest):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue