From: Ben Darnell Date: Sat, 2 Jul 2011 20:07:46 +0000 (-0700) Subject: Skip ipv6 tests if the system isn't configured for it. X-Git-Tag: v2.1.0~136^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6130ea63663a4f97efbf4afe0e34555f52f70ded;p=thirdparty%2Ftornado.git Skip ipv6 tests if the system isn't configured for it. --- diff --git a/tornado/test/httpclient_test.py b/tornado/test/httpclient_test.py index 999a1a131..c541818bb 100644 --- a/tornado/test/httpclient_test.py +++ b/tornado/test/httpclient_test.py @@ -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