summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
authorThomas Grainger <tagrain@gmail.com>2023-10-12 14:13:57 (GMT)
committerGitHub <noreply@github.com>2023-10-12 14:13:57 (GMT)
commit8c6c14b91bf95e04018151c53bce6e27e0e22447 (patch)
tree10032d3467d24b4ef7d490173b10ae3bc9f28b5e /Lib/test/test_asyncio
parent1e3460d9faaffb35b3c6175c666b1f45aea2c1d8 (diff)
downloadcpython-8c6c14b91bf95e04018151c53bce6e27e0e22447.zip
cpython-8c6c14b91bf95e04018151c53bce6e27e0e22447.tar.gz
cpython-8c6c14b91bf95e04018151c53bce6e27e0e22447.tar.bz2
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).
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_runners.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_runners.py b/Lib/test/test_asyncio/test_runners.py
index 1eb5641..13493d3 100644
--- a/Lib/test/test_asyncio/test_runners.py
+++ b/Lib/test/test_asyncio/test_runners.py
@@ -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):