Skip to content

Instantly share code, notes, and snippets.

@phuong
Forked from danverbraganza/tox.ini
Created May 30, 2017 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phuong/62f9458bf6803724cba7aef7b80001a4 to your computer and use it in GitHub Desktop.
Save phuong/62f9458bf6803724cba7aef7b80001a4 to your computer and use it in GitHub Desktop.
My standard tox.ini file that allows you to run coverage, lettuce, nosetests and lint, and to pick out a given feature or a module for nosetest (So that you don't have to run the whole suite)
[tox]
envlist=py27,lint
[testenv]
downloadcache={homedir}/.pipcache
distribute=True
sitepackages=False
[testenv:py27]
deps=nose
lettuce
coverage
mock
commands=
coverage erase
bash -c "test \"$(expr \"{posargs}\" : \".*\.feature\")\" -eq 0 && {envbindir}/coverage run {envbindir}/nosetests -w ./test/unit/ {posargs} || ( echo \"[TOX] Skipping nosetests\" && test \"$(expr \"{posargs}\" : \".*\.feature\")\" -ne 0 ) "
bash -c "test -z \"{posargs}\" -o `expr \"{posargs}\" : \".*\.feature\"` -ne 0 && {envbindir}/coverage run {envbindir}/lettuce ./test/features/{posargs} || ( echo \"[TOX] Skipping lettuce\" && test \"$(expr \"{posargs}\" : \".*\.feature\")\" -eq 0 ) "
coverage combine
coverage report --include=* -m
[testenv:lint]
basepython=python2.7
deps=pylint
commands=pylint juicer2 --rcfile=pylint.rc
[testenv:docs]
basepython=python
changedir=doc
deps=sphinx
commands=sphinx-build -b html ./source ./html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment