]> granicus.if.org Git - python/commitdiff
Issue #23972: Fix tests for Windows and Debian.
authorGuido van Rossum <guido@python.org>
Tue, 6 Oct 2015 15:24:10 +0000 (08:24 -0700)
committerGuido van Rossum <guido@python.org>
Tue, 6 Oct 2015 15:24:10 +0000 (08:24 -0700)
Lib/test/test_asyncio/test_base_events.py

index 156844001d0574e34a816101837825ee0cc98d63..54b771e8b28971983d633c7ef3f5feec5beb3564 100644 (file)
@@ -1215,6 +1215,7 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
 
     def test_create_datagram_endpoint_sock(self):
         sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+        sock.bind(('127.0.0.1', 0))
         fut = self.loop.create_datagram_endpoint(
             lambda: MyDatagramProto(create_future=True, loop=self.loop),
             sock=sock)
@@ -1307,10 +1308,6 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
             self.assertTrue(
                 sock.getsockopt(
                     socket.SOL_SOCKET, socket.SO_REUSEPORT))
-        else:
-            self.assertFalse(
-                sock.getsockopt(
-                    socket.SOL_SOCKET, socket.SO_REUSEPORT))
         self.assertTrue(
             sock.getsockopt(
                 socket.SOL_SOCKET, socket.SO_BROADCAST))