Skip to content

Commit 9346209

Browse files
miss-islingtonaeros
authored andcommitted
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 <[email protected]>
1 parent 3413f5c commit 9346209

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/test/test_asyncio/test_base_events.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,10 @@ def test_create_datagram_endpoint_reuse_address_warning(self):
17841784
reuse_address=False)
17851785

17861786
with self.assertWarns(DeprecationWarning):
1787-
self.loop.run_until_complete(coro)
1787+
transport, protocol = self.loop.run_until_complete(coro)
1788+
transport.close()
1789+
self.loop.run_until_complete(protocol.done)
1790+
self.assertEqual('CLOSED', protocol.state)
17881791

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

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

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

0 commit comments

Comments
 (0)