[v4 4/5] tox: Add tox.ini file
Stephen Finucane
stephenfinucane at hotmail.com
Mon Mar 23 08:03:22 AEDT 2015
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)
Signed-off-by: Stephen Finucane <stephenfinucane at hotmail.com>
---
apps/patchwork/tests/local_settings.py | 13 +++++++++++++
tox.ini | 28 ++++++++++++++++++++++++++++
2 files changed, 41 insertions(+)
create mode 100644 apps/patchwork/tests/local_settings.py
create mode 100644 tox.ini
diff --git a/apps/patchwork/tests/local_settings.py b/apps/patchwork/tests/local_settings.py
new file mode 100644
index 0000000..7c567ec
--- /dev/null
+++ b/apps/patchwork/tests/local_settings.py
@@ -0,0 +1,13 @@
+import os
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.mysql',
+ 'HOST': 'localhost',
+ 'PORT': '',
+ 'USER': os.environ['PW_TEST_DB_USER'],
+ 'PASSWORD': os.environ['PW_TEST_DB_PASS'],
+ 'NAME': 'patchwork',
+ 'TEST_CHARSET': 'utf8',
+ },
+}
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..159ad5d
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,28 @@
+[tox]
+envlist = py27,django15,django16,django17,pep8
+skipsdist = True
+
+[testenv:pep8]
+deps = flake8
+commands = flake8 {posargs}
+
+[flake8]
+ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405
+
+[testenv:django15]
+deps = -r{toxinidir}/docs/requirements-django-1.5-mysql.txt
+setenv =
+ PYTHONPATH = {toxinidir}/apps/patchwork/tests
+commands = {toxinidir}/apps/manage.py test patchwork
+
+[testenv:django16]
+deps = -r{toxinidir}/docs/requirements-django-1.6-mysql.txt
+setenv =
+ PYTHONPATH = {toxinidir}/apps/patchwork/tests
+commands = {toxinidir}/apps/manage.py test patchwork
+
+[testenv:django17]
+deps = -r{toxinidir}/docs/requirements-django-1.7-mysql.txt
+setenv =
+ PYTHONPATH = {toxinidir}/apps/patchwork/tests
+commands = {toxinidir}/apps/manage.py test patchwork
--
2.1.0
More information about the Patchwork
mailing list