[tox]
minversion=1.8.dev1
envlist = py{27,35,36,37}

[testenv]
cov_args=--cov=dogpile --cov-append --cov-report term --cov-report xml


setenv=
	BASECOMMAND=python -m pytest

	{generic}: 	RUNTESTS=-k 'not test_dbm_backend and not test_memcached_backend and not test_redis_backend'

	{memcached}: PIFPAF=pifpaf --env-prefix DOGPILE run memcached --port {env:TOX_DOGPILE_PORT:11234} --
	{memcached}: RUNTESTS=tests/cache/test_memcached_backend.py

	{redis}: PIFPAF=pifpaf --env-prefix DOGPILE run redis --port {env:TOX_DOGPILE_PORT:11234} --
	{redis}: RUNTESTS=tests/cache/test_redis_backend.py

	{dbm}: RUNTESTS=tests/cache/test_dbm_backend.py

    {cov}: COVERAGE={[testenv]cov_args}


deps=
	pytest
	mock
	Mako
	{memcached}: pylibmc

	# the py3k python-memcached fails for multiple
	# delete
	{py27-memcached}: python-memcached
	{memcached}: python-binary-memcached
	{memcached}: pifpaf
	{redis}: redis
	{redis}: pifpaf
	{cov}: pytest-cov

commands=
  {env:PIFPAF:} {env:BASECOMMAND} {env:COVERAGE:} {env:RUNTESTS:} {posargs}

sitepackages=False
usedevelop=True


[testenv:pep8]
deps=flake8
commands = python -m flake8 {posargs}


[flake8]

show-source = True
ignore = E711,E712,E721,D,N
# F841,F811,F401
exclude=.venv,.git,.tox,dist,doc,*egg,build


