2013-10-27 00:00:27 +00:00
|
|
|
# Tox (http://tox.readthedocs.org) is a tool for running tests
|
2011-07-17 23:52:56 +00:00
|
|
|
# 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.
|
|
|
|
#
|
2014-10-11 14:39:39 +00:00
|
|
|
# This configuration requires tox 1.8 or higher.
|
|
|
|
#
|
2014-01-15 04:16:26 +00:00
|
|
|
# Installation tips:
|
2013-10-27 00:00:27 +00:00
|
|
|
# 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.
|
2011-07-17 23:52:56 +00:00
|
|
|
[tox]
|
2014-01-15 04:16:26 +00:00
|
|
|
envlist =
|
|
|
|
# Basic configurations: Run the tests in both minimal installations
|
|
|
|
# and with all optional dependencies.
|
2014-10-11 14:39:39 +00:00
|
|
|
# (pypy3 doesn't have any optional deps yet)
|
2015-08-03 01:23:55 +00:00
|
|
|
{py26,py27,pypy,py32,py33,py34,py35,pypy3},
|
|
|
|
{py26,py27,pypy,py32,py33,py34,py35}-full,
|
2014-01-15 04:16:26 +00:00
|
|
|
|
|
|
|
# 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).
|
2014-10-11 14:39:39 +00:00
|
|
|
# py2 and py3 are aliases for py27-full and py34-full.
|
2014-01-15 04:16:26 +00:00
|
|
|
|
|
|
|
# Alternate HTTP clients.
|
2014-10-11 14:39:39 +00:00
|
|
|
{py2,py3}-curl,
|
2014-01-15 04:16:26 +00:00
|
|
|
|
|
|
|
# Alternate IOLoops.
|
2014-10-11 14:39:39 +00:00
|
|
|
{py2,py3}-select,
|
|
|
|
{py2,py26,py3}-full-twisted,
|
|
|
|
py2-twistedlayered,
|
2015-01-19 04:54:41 +00:00
|
|
|
{py3,py33}-full-asyncio,
|
|
|
|
{py26,py2}-full-trollius,
|
2014-01-15 04:16:26 +00:00
|
|
|
|
2014-05-19 00:34:30 +00:00
|
|
|
# Alternate Resolvers.
|
2014-10-11 14:39:39 +00:00
|
|
|
{py2,py3}-full-{threadedresolver},
|
|
|
|
{py2,py32}-full-caresresolver,
|
2014-05-19 00:34:30 +00:00
|
|
|
|
2014-01-15 04:16:26 +00:00
|
|
|
# Other configurations; see comments below.
|
2014-10-11 14:39:39 +00:00
|
|
|
{py2,py3}-{monotonic,opt},
|
|
|
|
py3-{lang_c,lang_utf8},
|
2014-01-15 04:16:26 +00:00
|
|
|
py2-locale,
|
2014-10-11 14:39:39 +00:00
|
|
|
{py27,py3}-unittest2,
|
2014-01-15 04:16:26 +00:00
|
|
|
|
|
|
|
# Ensure the sphinx build has no errors or warnings
|
2015-02-08 21:09:00 +00:00
|
|
|
py3-sphinx-docs,
|
|
|
|
# Run the doctests via sphinx (which covers things not run
|
|
|
|
# in the regular test suite and vice versa)
|
|
|
|
{py2,py3}-sphinx-doctest
|
2014-01-07 06:14:37 +00:00
|
|
|
|
2011-07-17 23:52:56 +00:00
|
|
|
[testenv]
|
2014-10-11 14:39:39 +00:00
|
|
|
# Most of these are defaults, but if you specify any you can't fall back
|
|
|
|
# defaults for the others.
|
|
|
|
basepython =
|
|
|
|
py26: python2.6
|
|
|
|
py27: python2.7
|
|
|
|
py32: python3.2
|
|
|
|
py33: python3.3
|
|
|
|
py34: python3.4
|
2015-08-03 01:23:55 +00:00
|
|
|
py35: python3.5
|
2014-10-11 14:39:39 +00:00
|
|
|
pypy: pypy
|
|
|
|
pypy3: pypy3
|
|
|
|
py2: python2.7
|
|
|
|
py3: python3.4
|
|
|
|
|
|
|
|
deps =
|
|
|
|
# unittest2 is a hard requirement on py26.
|
|
|
|
py26: unittest2
|
|
|
|
# unittest2 doesn't add anything we need on 2.7+, but we should ensure that
|
|
|
|
# its existence doesn't break anything due to conditional imports.
|
|
|
|
py27-unittest2: unittest2
|
|
|
|
py3-unittest2: unittest2py3k
|
|
|
|
# cpython-only deps: pycurl installs but curl_httpclient doesn't work;
|
|
|
|
# twisted mostly works but is a bit flaky under pypy.
|
2015-08-03 01:23:55 +00:00
|
|
|
{py26,py27,py32,py33,py34,py35}-full: pycurl
|
2014-10-11 14:39:39 +00:00
|
|
|
{py2,py3}: pycurl==7.19.3.1
|
|
|
|
# twisted is cpython only and doesn't support py32.
|
2015-08-03 01:23:55 +00:00
|
|
|
{py26,py27,py33,py34,py35}-full: twisted
|
2014-10-11 14:39:39 +00:00
|
|
|
{py2,py3}: twisted
|
|
|
|
# pycares installation currently fails on py33
|
|
|
|
# (https://github.com/pypa/pip/pull/816)
|
|
|
|
{py2,py26,py27,py32}-full: pycares
|
|
|
|
# futures became standard in py32
|
|
|
|
{py2,py26,py27,pypy}-full: futures
|
|
|
|
# mock became standard in py33
|
|
|
|
{py2,py26,py27,pypy,py3,py32,pypy3}-full: mock
|
2015-01-19 18:50:12 +00:00
|
|
|
# singledispatch became standard in py34. It mostly works on py26
|
|
|
|
# but has problems with old-style classes as used in that version.
|
|
|
|
{py2,py27,pypy,py3,py32,py33}-full: singledispatch
|
2014-10-11 14:39:39 +00:00
|
|
|
py33-asyncio: asyncio
|
|
|
|
trollius: trollius
|
|
|
|
py2-monotonic: Monotime
|
2015-02-08 21:09:00 +00:00
|
|
|
sphinx: sphinx
|
|
|
|
sphinx: sphinx_rtd_theme
|
2014-10-11 14:39:39 +00:00
|
|
|
|
|
|
|
setenv =
|
|
|
|
# The extension is mandatory on cpython.
|
2015-08-03 01:23:55 +00:00
|
|
|
{py2,py26,py27,py3,py32,py33,py34,py35}: TORNADO_EXTENSION=1
|
2014-10-11 14:39:39 +00:00
|
|
|
# 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.
|
|
|
|
lang_c: LANG=C
|
|
|
|
lang_utf8: LANG=en_US.utf-8
|
|
|
|
# tox's parser chokes if all the setenv entries are conditional.
|
|
|
|
DUMMY=dummy
|
2015-08-03 01:23:55 +00:00
|
|
|
{py2,py26,py27,py3,py32,py33,py34,py35}-no-ext: TORNADO_EXTENSION=0
|
2014-10-11 14:39:39 +00:00
|
|
|
|
|
|
|
# All non-comment lines but the last must end in a backslash.
|
|
|
|
# Tox filters line-by-line based on the environment name.
|
|
|
|
commands =
|
|
|
|
python \
|
|
|
|
# py3*: -b turns on an extra warning when calling
|
|
|
|
# str(bytes), and -bb makes it an error.
|
2015-08-03 01:23:55 +00:00
|
|
|
{py3,py32,py33,py34,py35,pypy3}: -bb \
|
2014-10-11 14:39:39 +00:00
|
|
|
# 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.
|
|
|
|
opt: -O \
|
|
|
|
-m tornado.test.runtests \
|
|
|
|
# Note that httpclient_test is always run with both client
|
|
|
|
# implementations; this flag controls which client all the
|
|
|
|
# other tests use.
|
|
|
|
curl: --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient \
|
|
|
|
select: --ioloop=tornado.platform.select.SelectIOLoop \
|
|
|
|
twisted: --ioloop=tornado.platform.twisted.TwistedIOLoop \
|
|
|
|
twistedlayered: --ioloop=tornado.test.twisted_test.LayeredTwistedIOLoop --resolver=tornado.platform.twisted.TwistedResolver \
|
|
|
|
{asyncio,trollius}: --ioloop=tornado.platform.asyncio.AsyncIOLoop \
|
|
|
|
caresresolver: --resolver=tornado.platform.caresresolver.CaresResolver \
|
|
|
|
threadedresolver: --resolver=tornado.netutil.ThreadedResolver \
|
|
|
|
monotonic: --ioloop_time_monotonic \
|
|
|
|
# Test with a non-english locale to uncover str/bytes mixing issues.
|
|
|
|
locale: --locale=zh_TW \
|
|
|
|
{posargs:}
|
2011-07-17 23:52:56 +00:00
|
|
|
|
|
|
|
# python will import relative to the current working directory by default,
|
|
|
|
# so cd into the tox working directory to avoid picking up the working
|
2014-01-19 23:55:53 +00:00
|
|
|
# copy of the files (especially important for the speedups module).
|
2011-07-17 23:52:56 +00:00
|
|
|
changedir = {toxworkdir}
|
|
|
|
|
2013-12-30 16:32:38 +00:00
|
|
|
# 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}
|
|
|
|
|
2015-02-08 21:09:00 +00:00
|
|
|
[testenv:py3-sphinx-docs]
|
2013-05-24 02:57:27 +00:00
|
|
|
changedir = docs
|
2014-10-11 14:39:39 +00:00
|
|
|
# For some reason the extension fails to load in this configuration,
|
|
|
|
# but it's not really needed for docs anyway.
|
|
|
|
setenv = TORNADO_EXTENSION=0
|
2013-05-24 02:57:27 +00:00
|
|
|
commands =
|
2013-05-24 04:19:46 +00:00
|
|
|
sphinx-build -q -E -n -W -b html . {envtmpdir}/html
|
2015-02-08 21:09:00 +00:00
|
|
|
|
|
|
|
[testenv:py2-sphinx-doctest]
|
|
|
|
changedir = docs
|
|
|
|
setenv = TORNADO_EXTENSION=0
|
2015-02-09 05:19:47 +00:00
|
|
|
# No -W for doctests because that disallows tests with empty output.
|
2015-02-08 21:09:00 +00:00
|
|
|
commands =
|
2015-02-09 05:19:47 +00:00
|
|
|
sphinx-build -q -E -n -b doctest . {envtmpdir}/doctest
|
2015-02-08 21:09:00 +00:00
|
|
|
|
|
|
|
[testenv:py3-sphinx-doctest]
|
|
|
|
changedir = docs
|
|
|
|
setenv = TORNADO_EXTENSION=0
|
|
|
|
commands =
|
2015-02-09 05:19:47 +00:00
|
|
|
sphinx-build -q -E -n -b doctest . {envtmpdir}/doctest
|