]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix warnings in test_asyncio.test_base_events (#17577)
authorKyle Stanley <aeros167@gmail.com>
Thu, 12 Dec 2019 13:48:20 +0000 (08:48 -0500)
committerŁukasz Langa <lukasz@langa.pl>
Thu, 12 Dec 2019 13:48:20 +0000 (14:48 +0100)
Co-authored-by: tirkarthi
Lib/test/test_asyncio/test_base_events.py

index 6c0f00dc93647478f96c05720291c7a256f839d4..fc832d3467131929b9e0a4ba748c4d659bb3dd20 100644 (file)
@@ -1814,7 +1814,10 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
             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):
@@ -1824,7 +1827,6 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
         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)
@@ -1843,7 +1845,6 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
         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)