[Python-checkins] Fix warnings in test_asyncio.test_base_events (GH-17577) (GH-17579)

Ned Deily webhook-mailer at python.org
Mon Dec 16 23:11:16 EST 2019


https://github.com/python/cpython/commit/d21ad67d5ec7a08e760231c967f4d8b0c148d18f
commit: d21ad67d5ec7a08e760231c967f4d8b0c148d18f
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Ned Deily <nad at python.org>
date: 2019年12月16日T23:11:11-05:00
summary:
Fix warnings in test_asyncio.test_base_events (GH-17577) (GH-17579)
Co-authored-by: tirkarthi
(cherry picked from commit 1988344a6bff253f017e053f69318ecf03587294)
Co-authored-by: Kyle Stanley <aeros167 at gmail.com>
files:
M Lib/test/test_asyncio/test_base_events.py
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index 3a23059911211..0f9e3d04d78eb 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -1808,7 +1808,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):
@@ -1818,7 +1821,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)
@@ -1837,7 +1839,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)


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /