# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

[tox]
envlist =
    # We test in environments using two versions of python (3.4 and 3.5) and
    # two versions of Django (1.8 and 1.9):
    # Specify a single environment when running tests with -e, eg:
    # tox -e py35-django19
    py34-django{18,19}
    py35-django{18,19}
    coverage

# Dependencies and ENV things we need for all environments:
[base]
deps =
    factory-boy==2.7.0
    freezegun==0.3.7
    responses==0.5.1
setenv =
    DJANGO_SETTINGS_MODULE=tests.test_settings
    PYTHONPATH={toxinidir}

[testenv]
deps =
    {[base]deps}
    # Any environment containing django18 or django19 will install appropriate
    # version of Django:
    django18: Django >= 1.8, < 1.9
    django19: Django >= 1.9, < 1.10
setenv =
    {[base]setenv}
# posargs will be replaced with anything after the -- when calling tox, eg;
# tox -- tests.ditto.tests.test_views.DittoViewTests.test_home_templates
# would run that single test (in all environments):
commands = django-admin.py test {posargs:}

[testenv:coverage]
deps =
    {[base]deps}
    Django >= 1.9, < 1.10
    coverage
    coveralls
setenv =
    {[base]setenv}
commands =
    coverage run --branch --source=ditto --omit=*/migrations/*.py {envbindir}/django-admin.py test
    coverage report
    coverage html

