FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
tox.ini 2.33 KiB
Newer Older
# Tox runner configuration
#
# The following optional environment variables can change behaviour. See the
# comments where they are used for more information.
#
# - TOXINI_ARTEFACT_DIR
# - TOXINI_FLAKE8_VERSION
# - TOXINI_WORK_DIR
#
[tox]
# Envs which should be run by default. This will execute a matrix of tests
envlist =
    py{27,34,35,36}-django111
    py{34,35,36,37}-django20
    py{35,36,37}-django21
    coverage
    flake8
# Allow overriding toxworkdir via environment variable
toxworkdir={env:TOXINI_WORK_DIR:{toxinidir}/.tox}
# Do not attempt to create .egg-info directories in the application root as it
# is mounted as a read-only volume.
skipsdist=true

# The "_vars" section is ignored by tox but we place some useful shared
# variables in it to avoid needless repetition.
[_vars]
# Where to write build artefacts. We default to the "build" directory in the
# tox.ini file's directory. Override with the TOXINI_ARTEFACT_DIR environment
# variable.
build_root={env:TOXINI_ARTEFACT_DIR:{toxinidir}/build}

[testenv]
setenv=
#   Override the coverage dtaa file location since the application root is
#   mounted read-only.
    COVERAGE_FILE={env:TOXINI_COVERAGE_FILE:{toxinidir}/.coverage}
# Additional dependencies
deps=
msb's avatar
msb committed
    mock
    coverage
    django111: Django>=1.11,<2.0
    django20: Django>=2.0,<2.1
    django21: Django>=2.1,<2.2
# Specify the default environment.
commands=
    coverage run --source={toxinidir} ./runtests.py

# Check for PEP8 violations
[testenv:flake8]
basepython=python3
deps=
    -rrequirements.txt
#   We specify a specific version of flake8 to avoid introducing "false"
#   regressions when new checks are introduced. The version of flake8 used may
#   be overridden via the TOXINI_FLAKE8_VERSION environment variable.
msb's avatar
msb committed
    mock
    flake8=={env:TOXINI_FLAKE8_VERSION:3.6.0}
commands=
    flake8 --version
    flake8 .

# Check for PEP8 violations
[testenv:coverage]
basepython=python3
deps=
msb's avatar
msb committed
    mock
    coverage
    django
# Specify the default environment. Note that tox will *always* use the testsuite
# settings unless overridden by TOX_DJANGO_SETTINGS_MODULE. Just setting
# DJANGO_SETTINGS_MODULE will not override it.
commands=
    coverage run --source={toxinidir} ./runtests.py
    coverage html --directory {[_vars]build_root}/htmlcov/
    coverage report
    coverage xml -o {env:COVERAGE_XML_FILE:{[_vars]build_root}/coverage.xml}