8000 Fix warnings in test_asyncio.test_base_events (GH-17577) (GH-17579) · python/cpython@d21ad67 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit d21ad67

Browse files
miss-islingtonaeros
authored andcommitted
Fix warnings in test_asyncio.test_base_events (GH-17577) (GH-17579)
Co-authored-by: tirkarthi (cherry picked from commit 1988344) Co-authored-by: Kyle Stanley <aeros167@gmail.com>
1 parent a96e938 commit d21ad67

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
@@ -1808,7 +1808,10 @@ def test_create_datagram_endpoint_reuse_address_warning(self):
18081808
reuse_address=False)
18091809

18101810
with self.assertWarns(DeprecationWarning):
1811-
self.loop.run_until_complete(coro)
1811+
transport, protocol = self.loop.run_until_complete(coro)
1812+
transport.close()
1813+
self.loop.run_until_complete(protocol.done)
1814+
self.assertEqual('CLOSED', protocol.state)
18121815

18131816
@patch_socket
18141817
def test_create_datagram_endpoint_nosoreuseport(self, m_socket):
@@ -1818,7 +1821,6 @@ def test_create_datagram_endpoint_nosoreuseport(self, m_socket):
18181821
coro = self.loop.create_datagram_endpoint(
18191822
lambda: MyDatagramProto(loop=self.loop),
18201823
local_addr=('127.0.0.1', 0),
1821-
reuse_address=False,
18221824
reuse_port=True)
18231825

18241826
self.assertRaises(ValueError, self.loop.run_until_complete, coro)
@@ -1837,7 +1839,6 @@ def getaddrinfo(*args, **kw):
18371839
coro = self.loop.create_datagram_endpoint(
18381840
lambda: MyDatagramProto(loop=self.loop),
18391841
local_addr=('1.2.3.4', 0),
1840-
reuse_address=False,
18411842
reuse_port=reuseport_supported)
18421843

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

0 commit comments

Comments
 (0)
0