summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_windows_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_windows_events.py')
-rw-r--r--Lib/test/test_asyncio/test_windows_events.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/Lib/test/test_asyncio/test_windows_events.py b/Lib/test/test_asyncio/test_windows_events.py
index e201a06..13aef7c 100644
--- a/Lib/test/test_asyncio/test_windows_events.py
+++ b/Lib/test/test_asyncio/test_windows_events.py
@@ -17,6 +17,7 @@ import _winapi
import asyncio
from asyncio import windows_events
+from asyncio.streams import _StreamProtocol
from test.test_asyncio import utils as test_utils
from test.support.script_helper import spawn_python
@@ -100,16 +101,16 @@ class ProactorTests(test_utils.TestCase):
clients = []
for i in range(5):
- stream_reader = asyncio.StreamReader(loop=self.loop,
- _asyncio_internal=True)
- protocol = asyncio.StreamReaderProtocol(stream_reader,
- loop=self.loop,
- _asyncio_internal=True)
+ stream = asyncio.Stream(mode=asyncio.StreamMode.READ,
+ loop=self.loop, _asyncio_internal=True)
+ protocol = _StreamProtocol(stream,
+ loop=self.loop,
+ _asyncio_internal=True)
trans, proto = await self.loop.create_pipe_connection(
lambda: protocol, ADDRESS)
self.assertIsInstance(trans, asyncio.Transport)
self.assertEqual(protocol, proto)
- clients.append((stream_reader, trans))
+ clients.append((stream, trans))
for i, (r, w) in enumerate(clients):
w.write('lower-{}\n'.format(i).encode())
@@ -118,6 +119,7 @@ class ProactorTests(test_utils.TestCase):
response = await r.readline()
self.assertEqual(response, 'LOWER-{}\n'.format(i).encode())
w.close()
+ await r.close()
server.close()