diff --git a/tornado/test/tcpclient_test.py b/tornado/test/tcpclient_test.py index 402488c3f3..a12f5aafd7 100644 --- a/tornado/test/tcpclient_test.py +++ b/tornado/test/tcpclient_test.py @@ -67,8 +67,9 @@ def tearDown(self): super(TCPClientTest, self).tearDown() def skipIfLocalhostV4(self): - families = set(sockaddr[0] - for sockaddr in socket.getaddrinfo('localhost', 0)) + Resolver().resolve('localhost', 0, callback=self.stop) + addrinfo = self.wait() + families = set(addr[0] for addr in addrinfo) if socket.AF_INET6 not in families: self.skipTest("localhost does not resolve to ipv6") diff --git a/tox.ini b/tox.ini index 3f38572766..65b150ae31 100644 --- a/tox.ini +++ b/tox.ini @@ -31,6 +31,9 @@ envlist = py2-twisted, py26-twisted, py2-twistedlayered, py3-asyncio, py33-asyncio, py26-trollius, py2-trollius, + # Alternate Resolvers. + py2-caresresolver, py3-caresresolver, + # Other configurations; see comments below. py2-monotonic, py3-monotonic, py2-opt, py3-opt, @@ -206,6 +209,17 @@ deps = trollius>=0.1.3 commands = python -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop {posargs:} +[testenv:py2-caresresolver] +basepython = python2.7 +deps = {[testenv:py27-full]deps} +commands = python -m tornado.test.runtests --resolver=tornado.platform.caresresolver.CaresResolver {posargs:} + +[testenv:py3-caresresolver] +# pycares does not install on python 3.3+ +basepython = python3.2 +deps = {[testenv:py32-full]deps} +commands = python -m tornado.test.runtests --resolver=tornado.platform.caresresolver.CaresResolver {posargs:} + [testenv:py2-monotonic] basepython = python2.7 deps =