Skip to content
Permalink
Browse files

Fix warnings in test_asyncio.test_base_events (GH-17577) (GH-17580)

Co-authored-by: tirkarthi
(cherry picked from commit 1988344)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
  • Loading branch information
2 people authored and ned-deily committed Dec 17, 2019
1 parent 8a06c9e commit c70c8ca746b776fa9a2d6d3e1dda278c8f560200
Showing with 4 additions and 3 deletions.
  1. +4 −3 Lib/test/test_asyncio/test_base_events.py
@@ -1784,7 +1784,10 @@ def test_create_datagram_endpoint_reuse_address_warning(self):
reuse_address=False)

with self.assertWarns(DeprecationWarning):
self.loop.run_until_complete(coro)
transport, protocol = self.loop.run_until_complete(coro)
transport.close()
self.loop.run_until_complete(protocol.done)
self.assertEqual('CLOSED', protocol.state)

@patch_socket
def test_create_datagram_endpoint_nosoreuseport(self, m_socket):
@@ -1794,7 +1797,6 @@ def test_create_datagram_endpoint_nosoreuseport(self, m_socket):
coro = self.loop.create_datagram_endpoint(
lambda: MyDatagramProto(loop=self.loop),
local_addr=('127.0.0.1', 0),
reuse_address=False,
reuse_port=True)

self.assertRaises(ValueError, self.loop.run_until_complete, coro)
@@ -1813,7 +1815,6 @@ def getaddrinfo(*args, **kw):
coro = self.loop.create_datagram_endpoint(
lambda: MyDatagramProto(loop=self.loop),
local_addr=('1.2.3.4', 0),
reuse_address=False,
reuse_port=reuseport_supported)

t, p = self.loop.run_until_complete(coro)

0 comments on commit c70c8ca

Please sign in to comment.
You can’t perform that action at this time.