[tox]
envlist = py27,pypy,py34,py35,py36,clean

[testenv]
whitelist_externals = rm
changedir = {toxworkdir}
deps =
  -rrequirements/test.txt
basepython =
  py27: python2.7
  pypy: pypy
  py34: python3.4
  py35: python3.5
  py36: python3.6
commands =
  pip install -q -e {toxinidir}
  coverage erase
  flake8 m2r.py tests
  coverage run -m unittest discover {toxinidir}/tests
  rm -rf {toxinidir}/testdoc/_build/html
  coverage run -a -m sphinx -b html -d {toxinidir}/testdoc/_build/toctree -E -W -q {toxinidir}/testdoc {toxinidir}/testdoc/_build/html
  rm -rf {toxinidir}/testdoc/_build/html
  coverage report --include "*m2r.py,*m2r/tests*"

[testenv:clean]
whitelist_externals = make
basepython = python
changedir = {toxinidir}
commands =
  make clean

[tox]
envlist = py27,pypy,py34,py35,py36,clean

[testenv]
whitelist_externals = rm
changedir = {toxworkdir}
deps =
  -rrequirements/test.txt
basepython =
  py27: python2.7
  pypy: pypy
  py34: python3.4
  py35: python3.5
  py36: python3.6
commands =
  pip install -q -e {toxinidir}
  coverage erase
  flake8 m2r.py tests
  coverage run -m unittest discover {toxinidir}/tests
  rm -rf {toxinidir}/testdoc/_build/html
  coverage run -a -m sphinx -b html -d {toxinidir}/testdoc/_build/toctree -E -W -q {toxinidir}/testdoc {toxinidir}/testdoc/_build/html
  rm -rf {toxinidir}/testdoc/_build/html
  coverage report --include "*m2r.py,*m2r/tests*"

[flake8]
exclude = docs/*,testdoc/*,.git,__pycache__,.tox,.eggs,*.egg

[testenv:clean]
whitelist_externals = make
basepython = python
changedir = {toxinidir}
commands =
  make clean

Exclude docs dir on flake8
Exclude docs dir on flake8
