cpython: 603025e2d39d (original) (raw)

Mercurial > cpython

changeset 72065:603025e2d39d

Issue #12656: Fix test_asyncore failures on Windows buildbots. [#12656]

Charles-François Natali neologix@free.fr
date Thu, 25 Aug 2011 00:50:41 +0200
parents b07b0b7517da
children f3444d795062
files Lib/test/test_asyncore.py
diffstat 1 files changed, 7 insertions(+), 5 deletions(-)[+] [-] Lib/test/test_asyncore.py 12

line wrap: on

line diff

--- a/Lib/test/test_asyncore.py +++ b/Lib/test/test_asyncore.py @@ -20,6 +20,8 @@ except ImportError: HOST = support.HOST +HAS_UNIX_SOCKETS = hasattr(socket, 'AF_UNIX') + class dummysocket: def init(self): self.closed = False @@ -89,7 +91,7 @@ def capture_server(evt, buf, serv): def bind_af_aware(sock, addr): """Helper function to bind a socket according to its family."""

class TestClient(BaseClient): @@ -708,7 +710,7 @@ class BaseTestAPI(unittest.TestCase): self.assertEqual(s.socket.type, socket.SOCK_STREAM | SOCK_NONBLOCK) def test_bind(self):

@@ -722,7 +724,7 @@ class BaseTestAPI(unittest.TestCase): self.assertRaises(socket.error, s2.bind, (self.addr[0], port)) def test_set_reuse_addr(self):

@@ -753,7 +755,7 @@ class TestAPI_UseIPv6Sockets(BaseTestAPI family = socket.AF_INET6 addr = ('::1', 0) -@unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'Unix sockets required') +@unittest.skipUnless(HAS_UNIX_SOCKETS, 'Unix sockets required') class TestAPI_UseUnixSockets(BaseTestAPI): family = socket.AF_UNIX addr = support.TESTFN