[tox]
envlist = py27,docs

[testenv]
#install_command = {toxinidir}/tools/tox_install_cmd {opts} {packages}
usedevelop = True

deps =
  setuptools >= 12

whitelist_externals =
  /usr/bin/find

commands =
  pip install -e '.[dev]'

  # Useful info in case of failure
  pip list

  # Run tests
  py.test --tb=short                            \
          --junitxml=junit-{envname}.xml        \
          --cov abilian                         \
          --cov-report term-missing             \
          --cov-report html                     \
          --cov-report xml                      \
          .

[testenv:py27]
setenv =
  SQLALCHEMY_DATABASE_URI = sqlite://

[testenv:py27_postgres]
setenv =
  SQLALCHEMY_DATABASE_URI = postgres://yaka_core_test:test_pw@localhost:5432/yaka_core_test

[testenv:docs]
commands =
  pip install -e '.[dev]'
  find . -name "*.pyc" -delete
  python setup.py clean
  sphinx-build -W -b html docs/ docs/_build/html
