# Tox (http://tox.readthedocs.org) is a tool for running tests # in multiple virtualenvs. This configuration file will run the tornado # test suite on all supported python versions. To use it, "pip install tox" # and then run "tox" from this directory. # # Installation tips: # When building pycurl on my macports-based setup, I need to either set the # environment variable ARCHFLAGS='-arch x86_64' or use # 'port install curl +universal' to get both 32- and 64-bit versions of # libcurl. [tox] envlist = # Basic configurations: Run the tests in both minimal installations # and with all optional dependencies. py26, py26-full, py27, py27-full, py32, py32-full, py33, py33-full, py34, py34-full, pypy, pypy-full, # Also run the tests with each possible replacement of a default # component. Run each test on both python 2 and 3 where possible. # (Only one 2.x and one 3.x unless there are known differences). # Alternate HTTP clients. py2-curl, py3-curl, # Alternate IOLoops. py2-select, py3-select, py2-twisted, py26-twisted, py2-twistedlayered, py3-asyncio, py33-asyncio, py26-trollius, py2-trollius, # Other configurations; see comments below. py2-monotonic, py3-monotonic, py2-opt, py3-opt, py3-utf8, py2-locale, # Ensure the sphinx build has no errors or warnings py2-docs [testenv] commands = python -m tornado.test.runtests {posargs:} # python will import relative to the current working directory by default, # so cd into the tox working directory to avoid picking up the working # copy of the files (especially important for the speedups module). changedir = {toxworkdir} # tox 1.6 passes --pre to pip by default, which currently has problems # installing pycurl and monotime (https://github.com/pypa/pip/issues/1405). # Remove it (it's not a part of {opts}) to only install real releases. install_command = pip install {opts} {packages} [testenv:py26] basepython = python2.6 deps = unittest2 [testenv:py26-full] basepython = python2.6 setenv = TORNADO_EXTENSION=1 deps = {[testenv:py26]deps} futures mock pycares pycurl twisted>=11.0.0 [testenv:py27-full] basepython = python2.7 setenv = TORNADO_EXTENSION=1 deps = futures mock pycares pycurl twisted>=11.0.0 # In python 3, opening files in text mode uses a system-dependent encoding by # default. Run the tests with "C" (ascii) and "utf-8" locales to ensure # we don't have hidden dependencies on this setting. [testenv:py32] basepython = python3.2 setenv = LANG=C # -b turns on an extra warning when calling str(bytes), and -bb makes # it an error. commands = python -bb -m tornado.test.runtests {posargs:} [testenv:py32-full] basepython = python3.2 setenv = TORNADO_EXTENSION=1 deps = mock pycares pycurl>=7.19.3 [testenv:py33-full] basepython = python3.3 setenv = TORNADO_EXTENSION=1 # pycares installation currently fails on py33 # (https://github.com/pypa/pip/pull/816) deps = pycurl>=7.19.3 [testenv:py34-full] basepython = python3.4 setenv = TORNADO_EXTENSION=1 # pycares installation currently fails on py34 # (https://github.com/pypa/pip/pull/816) deps = pycurl>=7.19.3 [testenv:pypy-full] # This configuration works with pypy 1.9. pycurl installs ok but # curl_httpclient doesn't work. pycares also installs but doesn't # work. Twisted works most of the time, but its tests seem flaky # under pypy, so we don't run it for now. Also note that travis-ci # does not yet have support for building C extensions with pypy, so we # don't try to run this configuration there. basepython = pypy deps = futures mock [testenv:py2-curl] # Same as py27-full, but runs the tests with curl_httpclient by default. # Note that httpclient_test is always run with both client implementations; # this flag controls which client all the other tests use. basepython = python2.7 deps = {[testenv:py27-full]deps} commands = python -m tornado.test.runtests --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient {posargs:} [testenv:py3-curl] basepython = python3.3 deps = {[testenv:py33-full]deps} commands = python -m tornado.test.runtests --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient {posargs:} [testenv:py2-select] # Same as py27-full, but runs the tests with the select IOLoop. # The other tests will run with the most platform-appropriate implementation, # but this one is the lowest common denominator and should work anywhere. basepython = python2.7 deps = {[testenv:py27-full]deps} commands = python -m tornado.test.runtests --ioloop=tornado.platform.select.SelectIOLoop {posargs:} [testenv:py3-select] basepython = python3.3 deps = {[testenv:py33-full]deps} commands = python -m tornado.test.runtests --ioloop=tornado.platform.select.SelectIOLoop {posargs:} [testenv:py2-twisted] basepython = python2.7 deps = {[testenv:py27-full]deps} commands = python -m tornado.test.runtests --ioloop=tornado.platform.twisted.TwistedIOLoop {posargs:} [testenv:py26-twisted] basepython = python2.6 deps = {[testenv:py26-full]deps} commands = python -m tornado.test.runtests --ioloop=tornado.platform.twisted.TwistedIOLoop {posargs:} [testenv:py2-twistedlayered] basepython = python2.7 deps = {[testenv:py27-full]deps} commands = python -m tornado.test.runtests --ioloop=tornado.test.twisted_test.LayeredTwistedIOLoop --resolver=tornado.platform.twisted.TwistedResolver {posargs:} [testenv:py3-asyncio] basepython = python3.4 deps = {[testenv:py34-full]deps} commands = python -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop {posargs:} [testenv:py33-asyncio] basepython = python3.3 deps = {[testenv:py33-full]deps} asyncio commands = python -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop {posargs:} # Trollius is the py2 backport of asyncio. [testenv:py2-trollius] basepython = python2.7 deps = {[testenv:py27-full]deps} trollius>=0.1.1 commands = python -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop {posargs:} [testenv:py26-trollius] basepython = python2.6 deps = {[testenv:py26-full]deps} trollius>=0.1.3 commands = python -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop {posargs:} [testenv:py2-monotonic] basepython = python2.7 deps = {[testenv:py27-full]deps} Monotime commands = python -m tornado.test.runtests --ioloop_time_monotonic {posargs:} # Note that this test only works in py33+ (the Monotime backport package is # only for 2.x) [testenv:py3-monotonic] basepython = python3.3 deps = {[testenv:py33-full]deps} commands = python -m tornado.test.runtests --ioloop_time_monotonic {posargs:} # Python's optimized mode disables the assert statement, so run the # tests in this mode to ensure we haven't fallen into the trap of relying # on an assertion's side effects or using them for things that should be # runtime errors. [testenv:py2-opt] basepython = python2.7 deps = {[testenv:py27-full]deps} commands = python -O -m tornado.test.runtests {posargs:} [testenv:py3-opt] basepython = python3.3 deps = {[testenv:py33-full]deps} commands = python -O -m tornado.test.runtests {posargs:} # Test with a non-english locale to uncover str/bytes mixing issues. [testenv:py2-locale] basepython = python2.7 commands = python -m tornado.test.runtests --locale=zh_TW {posargs:} [testenv:py3-locale] basepython = python3.3 commands = python -m tornado.test.runtests --locale=zh_TW {posargs:} # This test is the counterpart to the LANG=C in testenv:py33. [testenv:py3-utf8] basepython = python3.3 setenv = LANG=en_US.utf-8 [testenv:py2-docs] basepython = python2.7 changedir = docs deps = sphinx==1.2 commands = sphinx-build -q -E -n -W -b html . {envtmpdir}/html