diff options
| author | Yury Selivanov <yury@magic.io> | 2016-11-09 20:47:00 (GMT) |
|---|---|---|
| committer | Yury Selivanov <yury@magic.io> | 2016-11-09 20:47:00 (GMT) |
| commit | a1a8b7d3d7f628aec31be364c77cbb3e21cdbc0b (patch) | |
| tree | f1c1fa5ae61d965d131a437904bd1712c7a6f017 /Lib/test/test_asyncio/test_events.py | |
| parent | d2fd3599abeed393ccdf4ee5cf1c7b346ba4a022 (diff) | |
| download | cpython-a1a8b7d3d7f628aec31be364c77cbb3e21cdbc0b.zip cpython-a1a8b7d3d7f628aec31be364c77cbb3e21cdbc0b.tar.gz cpython-a1a8b7d3d7f628aec31be364c77cbb3e21cdbc0b.tar.bz2 | |
Issue #28652: Make loop methods reject socket kinds they do not support.
Diffstat (limited to 'Lib/test/test_asyncio/test_events.py')
| -rw-r--r-- | Lib/test/test_asyncio/test_events.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 5b32332..28d92a9 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -791,9 +791,9 @@ class EventLoopTestsMixin: conn, _ = lsock.accept() proto = MyProto(loop=loop) proto.loop = loop - f = loop.create_task( + loop.run_until_complete( loop.connect_accepted_socket( - (lambda : proto), conn, ssl=server_ssl)) + (lambda: proto), conn, ssl=server_ssl)) loop.run_forever() proto.transport.close() lsock.close() @@ -1377,6 +1377,11 @@ class EventLoopTestsMixin: server.transport.close() def test_create_datagram_endpoint_sock(self): + if (sys.platform == 'win32' and + isinstance(self.loop, proactor_events.BaseProactorEventLoop)): + raise unittest.SkipTest( + 'UDP is not supported with proactor event loops') + sock = None local_address = ('127.0.0.1', 0) infos = self.loop.run_until_complete( @@ -1394,7 +1399,7 @@ class EventLoopTestsMixin: else: assert False, 'Can not create socket.' - f = self.loop.create_connection( + f = self.loop.create_datagram_endpoint( lambda: MyDatagramProto(loop=self.loop), sock=sock) tr, pr = self.loop.run_until_complete(f) self.assertIsInstance(tr, asyncio.Transport) |
