]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Skip ipv6 tests if the system isn't configured for it.
authorBen Darnell <ben@bendarnell.com>
Sat, 2 Jul 2011 20:07:46 +0000 (13:07 -0700)
committerBen Darnell <ben@bendarnell.com>
Sat, 2 Jul 2011 20:07:46 +0000 (13:07 -0700)
tornado/test/httpclient_test.py

index 999a1a131751d2f8d3f5e3781cb3c29dbe2c8f5d..c541818bb309422577a49cb5baf90ea6f5da236e 100644 (file)
@@ -203,7 +203,13 @@ class HTTPClientCommonTestCase(AsyncHTTPTestCase, LogTrapTestCase):
         self.assertEqual(response.body, byte_body)
 
     def test_ipv6(self):
-        self.http_server.bind(self.get_http_port(), address='::1')
+        try:
+            self.http_server.bind(self.get_http_port(), address='::1')
+        except socket.gaierror, e:
+            if e.errno == socket.EAI_ADDRFAMILY:
+                # ipv6 is not configured on this system, so skip this test
+                return
+            raise
         url = self.get_url("/hello").replace("localhost", "[::1]")
 
         # ipv6 is currently disabled by default and must be explicitly requested