Skip to content

Commit

Permalink
Fix warnings in test_asyncio.test_base_events (python#17577)
Browse files Browse the repository at this point in the history
Co-authored-by: tirkarthi
  • Loading branch information
aeros authored and ambv committed Dec 12, 2019
1 parent 7772b1a commit 1988344
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Lib/test/test_asyncio/test_base_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -1814,7 +1814,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):
Expand All @@ -1824,7 +1827,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)
Expand All @@ -1843,7 +1845,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)
Expand Down

0 comments on commit 1988344

Please sign in to comment.