# 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.
[pytest]
python_files = test_*.py
django_find_project = false

[tox]
skipsdist = True
envlist = py{27,36}-django111,py36-django{200,210}

[travis]
python =
  2.7: py27
  3.6: py36

[travis:env]
DJANGO =
  1.11: django111
  2.0: django200
  2.1: django210

[testenv]
changedir = {toxinidir}/django_comments_xtd
commands = py.test -rw --cov-config .coveragerc --cov django_comments_xtd
deps =
    six
    docutils
    Markdown
    django-markup
    pytest
    pytest-cov
    pytest-django
    selenium
    py27-django111: Django>=1.11,<1.12
    py36-django111: Django>=1.11,<1.12
    py36-django200: Django>=2.0,<2.1
    py36-django210: Django>=2.1,<2.2
    py{27,36}-django{111,200,210}: djangorestframework>=3.8,<3.9
    py27-django111: django-contrib-comments
    py36-django{111,200,210}: django-contrib-comments
    py27: mock
setenv = 
    PYTHONPATH = {toxinidir}:{toxinidir}
    DJANGO_SETTINGS_MODULE=django_comments_xtd.tests.settings

[testenv:pep8]
show-source = True
commands = {envbindir}/flake8 --max-line-length=80 --exclude=.tox,docs,django_comments_xtd/tests,django_comments_xtd/__init__.py,django_comments_xtd/migrations django_comments_xtd
# Flake8 only needed when linting.
# Do not care about other dependencies, it's just for linting.
deps = flake8
changedir = {toxinidir}

[testenv:js]
commands =
    npm install --prefix {toxinidir}
