Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b35ec00

Browse files
miss-islingtonaeros
authored andcommitted
Fix warnings in test_asyncio.test_base_events (GH-17577) (#17581)
Co-authored-by: tirkarthi (cherry picked from commit 1988344) Co-authored-by: Kyle Stanley <[email protected]>
1 parent bf62515 commit b35ec00

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
@@ -1708,7 +1708,10 @@ def test_create_datagram_endpoint_reuse_address_warning(self):
17081708
reuse_address=False)
17091709

17101710
with self.assertWarns(DeprecationWarning):
1711-
self.loop.run_until_complete(coro)
1711+
transport, protocol = self.loop.run_until_complete(coro)
1712+
transport.close()
1713+
self.loop.run_until_complete(protocol.done)
1714+
self.assertEqual('CLOSED', protocol.state)
17121715

17131716
@patch_socket
17141717
def test_create_datagram_endpoint_nosoreuseport(self, m_socket):
@@ -1718,7 +1721,6 @@ def test_create_datagram_endpoint_nosoreuseport(self, m_socket):
17181721
coro = self.loop.create_datagram_endpoint(
17191722
lambda: MyDatagramProto(loop=self.loop),
17201723
local_addr=('127.0.0.1', 0),
1721-
reuse_address=False,
17221724
reuse_port=True)
17231725

17241726
self.assertRaises(ValueError, self.loop.run_until_complete, coro)
@@ -1737,7 +1739,6 @@ def getaddrinfo(*args, **kw):
17371739
coro = self.loop.create_datagram_endpoint(
17381740
lambda: MyDatagramProto(loop=self.loop),
17391741
local_addr=('1.2.3.4', 0),
1740-
reuse_address=False,
17411742
reuse_port=reuseport_supported)
17421743

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

0 commit comments

Comments
 (0)