# 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. [flake8] max-line-length = 120 builtins = _,__request__ exclude = .tox, .git, dist, build ignore = E123,E133,E226,E241,E242 [tox] envlist = py27, py26, flake8, isort, docs [testenv] commands = {envpython} setup.py test sitepackages=True deps = twisted service_identity mako chardet pyopenssl pyxdg pytest whitelist_externals= py.test setenv = PYTHONPATH = {env:PYTHONPATH}:{env:PWD} [pytest] python_functions=test_ norecursedirs=.tox .git dist build pep8maxlinelength = 120 whitelist_externals= {[testenv]whitelist_externals} commands= py.test deluge [testenv:testcoverage] install_command=pip install {opts} {packages} deps = {[testenv]deps} pytest-cov coverage whitelist_externals= {[testenv]whitelist_externals} coverage commands= coverage run --branch --source=deluge -m py.test deluge/tests/ coverage report # For creating html report # coverage html -d docs/build/htmlcoverage [testenv:pydef] commands= python -c "import libtorrent as lt; print lt.version" py.test deluge/tests [testenv:plugins] commands= py.test deluge/plugins [testenv:py26] basepython=python2.6 commands= {[testenv:pydef]commands} [testenv:py27] basepython=python2.7 commands= {[testenv:pydef]commands} [testenv:isort] deps = {[testenv]deps} isort whitelist_externals= {[testenv]whitelist_externals} isort commands= python -c "import subprocess, sys; output = subprocess.check_output('isort --recursive --diff --stdout deluge docs/ *.py', shell=True); print output; sys.exit(len(output) != 0)" [testenv:flake8] setenv = {[testenv]setenv} whitelist_externals= {[testenv]whitelist_externals} flake8 deps = {[testenv]deps} flake8 pep8-naming commands= flake8 deluge [testenv:flake8-complexity] setenv = {[testenv]setenv} whitelist_externals= {[testenv]whitelist_externals} flake8 sh deps = {[testenv:flake8]deps} mccabe commands= sh -c "flake8 --max-complexity 10 deluge || true" [testenv:docscoverage] changedir=docs install_command=pip install {opts} {packages} deps = {[testenv]deps} sphinx sphinxcontrib-napoleon coverage pytest-cov whitelist_externals= {[testenv]whitelist_externals} mkdir sphinx-build commands= mkdir -p build/doccoverage sphinx-build -W -b coverage -d build/doctrees source build/doccoverage py.test --doctest-glob='*.rst' [testenv:docs] changedir=docs install_command=pip install {opts} --allow-external PIL --allow-unverified PIL {packages} whitelist_externals= {[testenv]whitelist_externals} sphinx-build deps = {[testenv]deps} sphinx sphinxcontrib-napoleon PIL commands= sphinx-build -E -W -b html -d build/doctrees source build/html