summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Finucane <stephenfinucane@hotmail.com>2015-04-07 22:20:55 +0100
committerJeremy Kerr <jk@ozlabs.org>2015-05-03 13:46:52 +0800
commitf09e982f58384946111d4157fd2b7c2b31b78612 (patch)
tree7cdd562f1bd2ce0e5d3fbe3fce797d7284f8caca
parentae639a6a6aea26b0648a0e2d2fd4bccd7a41c791 (diff)
downloadpatchwork-f09e982f58384946111d4157fd2b7c2b31b78612.tar.bz2
patchwork-f09e982f58384946111d4157fd2b7c2b31b78612.tar.xz
tox: Add tox.ini file
Currently this contains calls to execute the following on the code base: * Unit tests (for all currently supported versions of Django). This requires the addition of a "test" 'local_settings' file * PEP8 (or, rather, flake8) * PyLint * Coverage (based on unit tests) These are designed in such a way that it should be possible to easily add additional environment for testing (like Python3 or Django 1.8). Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r--tox.ini46
1 files changed, 46 insertions, 0 deletions
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..8d99e6a
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,46 @@
+[tox]
+envlist = {py27}-django{15,16,17}, pep8
+skipsdist = True
+
+[testenv:pep8]
+deps = flake8
+commands = flake8 {posargs}
+
+[flake8]
+ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405
+exclude = ./apps/patchwork/tests
+
+[testenv:lint]
+basepython = python2.7
+deps =
+ pylint
+ -r{toxinidir}/docs/requirements-django-1.7-mysql.txt
+commands = pylint apps --rcfile=pylint.rc
+
+[testenv:coverage]
+basepython = python2.7
+deps =
+ coverage
+ -r{toxinidir}/docs/requirements-django-1.6-mysql.txt
+setenv =
+ DJANGO_SETTINGS_MODULE = patchwork.settings.dev
+commands =
+ coverage erase
+ {toxinidir}/apps/manage.py syncdb
+ coverage run --omit=*tox* --branch {toxinidir}/apps/manage.py test patchwork
+ coverage report -m
+
+[testenv]
+basepython =
+ py27: python2.7
+commands =
+ {toxinidir}/apps/manage.py syncdb
+ {toxinidir}/apps/manage.py test patchwork
+deps =
+ python-dateutil==1.5
+ MySQL-python==1.2.5
+ django15: django<1.6,>=1.5
+ django16: django<1.7,>=1.6
+ django17: django<1.8,>=1.7
+setenv =
+ DJANGO_SETTINGS_MODULE = patchwork.settings.dev