Permalink
Fetching contributors…
Cannot retrieve contributors at this time
323 lines (260 sloc) 8.11 KB
[tox]
# --------------------------------------------------------------------
#
# NOTE(kgriffs): The py27, and py36 envs are required when
# checking combined coverage. To check coverage:
#
# $ tools/mintest.sh
#
# Which is equivalent to:
#
# $ rm -f .coverage.*
# $ tox -e py27,py36,pep8 && tools/testing/combine_coverage.sh
#
# You can then drill down into coverage details by opening the HTML
# report at ".coverage_html/index.html".
#
# If you are using pyenv and get an error along the lines of
# "failed to get version_info", you may need to activate all of
# the python version required by tox before trying again. For
# example:
#
# $ pyenv shell 2.7.13 3.6.2
#
# --------------------------------------------------------------------
envlist = py27,
py36,
pep8,
docs
[testenv]
setenv =
PIP_CONFIG_FILE={toxinidir}/pip.conf
deps = -r{toxinidir}/requirements/tests
commands = {toxinidir}/tools/clean.sh {toxinidir}/falcon
pytest tests []
# --------------------------------------------------------------------
# Coverage
# --------------------------------------------------------------------
[with-coverage]
whitelist_externals = mkdir
mv
commands = {toxinidir}/tools/clean.sh {toxinidir}/falcon
coverage run -m pytest tests []
[testenv:py27]
deps = {[testenv]deps}
pytest-randomly
whitelist_externals = {[with-coverage]whitelist_externals}
; setenv = TOXINIDIR={toxinidir}
commands = {[with-coverage]commands}
[testenv:py36]
deps = {[testenv]deps}
pytest-randomly
jsonschema
whitelist_externals = {[with-coverage]whitelist_externals}
commands = {[with-coverage]commands}
# --------------------------------------------------------------------
# Additional test suite environments
# --------------------------------------------------------------------
[testenv:py34]
basepython = python3.4
[testenv:pypy]
basepython = pypy
[testenv:pypy3]
basepython = pypy3
# --------------------------------------------------------------------
# Debugging
# --------------------------------------------------------------------
[with-debug-tools]
deps = -r{toxinidir}/requirements/tests
pdbpp
[testenv:py2_debug]
basepython = python2.7
deps = {[with-debug-tools]deps}
funcsigs
jsonschema
[testenv:py3_debug]
basepython = python3.6
deps = {[with-debug-tools]deps}
# --------------------------------------------------------------------
# ujson
# --------------------------------------------------------------------
[with-ujson]
deps = -r{toxinidir}/requirements/tests
ujson
[testenv:py27_ujson]
basepython = python2.7
deps = {[with-ujson]deps}
[testenv:py35_ujson]
basepython = python3.5
deps = {[with-ujson]deps}
[testenv:py36_ujson]
basepython = python3.6
deps = {[with-ujson]deps}
# --------------------------------------------------------------------
# Cython
# --------------------------------------------------------------------
[with-cython]
deps = -r{toxinidir}/requirements/tests
cython
[testenv:py27_cython]
basepython = python2.7
deps = {[with-cython]deps}
[testenv:py34_cython]
basepython = python3.4
deps = {[with-cython]deps}
[testenv:py35_cython]
basepython = python3.5
deps = {[with-cython]deps}
[testenv:py36_cython]
basepython = python3.6
deps = {[with-cython]deps}
# --------------------------------------------------------------------
# Smoke testing with a sample app
# --------------------------------------------------------------------
[smoke-test]
commands = falcon-bench -t 1 -b falcon-ext
[testenv:py27_smoke]
basepython = python2.7
deps = -r{toxinidir}/requirements/bench
commands = {[smoke-test]commands}
[testenv:py27_smoke_cython]
basepython = python2.7
deps = -r{toxinidir}/requirements/bench
cython
commands = {[smoke-test]commands}
[testenv:py36_smoke]
basepython = python3.6
deps = -r{toxinidir}/requirements/bench
commands = {[smoke-test]commands}
[testenv:py36_smoke_cython]
basepython = python3.6
deps = -r{toxinidir}/requirements/bench
cython
commands = {[smoke-test]commands}
# --------------------------------------------------------------------
# Lint
# --------------------------------------------------------------------
[testenv:py3kwarn]
basepython = python2.7
deps = py3kwarn
commands = py3kwarn falcon
[testenv:pep8]
deps = flake8
flake8-quotes
flake8-import-order
# NOTE(kgriffs): Run with py27 since some code branches assume the
# unicode type is defined, and pep8 complains in those cases when
# running under py3.
basepython = python2.7
commands = flake8 \
--max-complexity=15 \
--exclude=.ecosystem,.eggs,.tox,.venv,build,dist,docs,examples,falcon/bench/nuts \
--ignore=F403 \
--max-line-length=99 \
--import-order-style=google \
--application-import-names=falcon \
[]
[testenv:pep8-examples]
deps = flake8
flake8-quotes
flake8-import-order
# NOTE(kgriffs): Run with py27 since some code branches assume the
# unicode type is defined, and pep8 complains in those cases when
# running under py3.
basepython = python2.7
commands = flake8 examples \
--max-complexity=12 \
--ignore=F403 \
--max-line-length=99 \
--import-order-style=google \
--application-import-names=look \
[]
# --------------------------------------------------------------------
# For viewing environ dicts generated by various WSGI servers
# --------------------------------------------------------------------
[testenv:py27_dump_uwsgi]
basepython = python2.7
deps = uwsgi
commands = uwsgi --http localhost:8000 --wsgi-file {toxinidir}/tests/dump_wsgi.py
[testenv:py27_dump_gunicorn]
basepython = python2.7
deps = gunicorn
commands = gunicorn -b localhost:8000 tests.dump_wsgi
[testenv:py36_dump_gunicorn]
basepython = python3.6
deps = gunicorn
commands = gunicorn -b localhost:8000 tests.dump_wsgi
[testenv:py27_dump_waitress]
basepython = python2.7
deps = waitress
commands = waitress-serve --listen=localhost:8000 tests.dump_wsgi:application
[testenv:py27_dump_wsgiref]
basepython = python2.7
commands = python tests/dump_wsgi.py
[testenv:py36_dump_wsgiref]
basepython = python3.6
commands = python tests/dump_wsgi.py
# --------------------------------------------------------------------
# Benchmarking
# --------------------------------------------------------------------
[testenv:py27_bench]
basepython = python2.7
deps = -r{toxinidir}/requirements/bench
commands = falcon-bench []
[testenv:py27_bench_cython]
basepython = python2.7
deps = -r{toxinidir}/requirements/bench
cython
commands = falcon-bench []
[testenv:py34_bench]
basepython = python3.4
deps = -r{toxinidir}/requirements/bench
commands = falcon-bench []
[testenv:py34_bench_cython]
basepython = python3.4
deps = -r{toxinidir}/requirements/bench
cython
commands = falcon-bench []
[testenv:py35_bench]
basepython = python3.5
deps = -r{toxinidir}/requirements/bench
commands = falcon-bench []
[testenv:py35_bench_cython]
basepython = python3.5
deps = -r{toxinidir}/requirements/bench
cython
commands = falcon-bench []
[testenv:py36_bench]
basepython = python3.6
deps = -r{toxinidir}/requirements/bench
commands = falcon-bench []
[testenv:py36_bench_cython]
basepython = python3.6
deps = -r{toxinidir}/requirements/bench
cython
commands = falcon-bench []
[testenv:pypy_bench]
basepython = pypy
deps = -r{toxinidir}/requirements/bench
commands = falcon-bench []
[testenv:pypy3_bench]
basepython = pypy3
deps = -r{toxinidir}/requirements/bench
commands = falcon-bench []
# --------------------------------------------------------------------
# Documentation
# --------------------------------------------------------------------
[testenv:docs]
basepython = python2.7
deps = -r{toxinidir}/requirements/docs
commands =
sphinx-build -j 4 -W -E -b html docs docs/_build/html []
# --------------------------------------------------------------------
# Ecosystem
# --------------------------------------------------------------------
[testenv:hug]
basepython = python3.6
deps = virtualenv
commands =
{toxinidir}/tools/testing/install_hug.sh
{toxinidir}/tools/testing/test_hug.sh