Skip to content

Commit

Permalink
Set up tox for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
bennylope committed Jan 3, 2014
1 parent 50ff471 commit a55dbf5
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@ dist/
*.egg-info
docs/_build
*.sqlite
.tox
28 changes: 12 additions & 16 deletions .travis.yml
@@ -1,19 +1,15 @@
language: python
python:
- "2.6"
- "2.7"
- "3.3"
python: 2.7
env:
- DJANGO_INSTALL="Django==1.4.10"
- DJANGO_INSTALL="Django==1.5.5"
- DJANGO_INSTALL="Django==1.6.1"
- TOX_ENV=py33-django16
- TOX_ENV=py33-django15
- TOX_ENV=py27-django16
- TOX_ENV=py27-django15
- TOX_ENV=py27-django14
- TOX_ENV=py26-django16
- TOX_ENV=py26-django15
- TOX_ENV=py26-django14
install:
- pip install -q $DJANGO_INSTALL
- python setup.py -q install
script: ./runtests.sh
matrix:
exclude:
- python: "3.3"
env: DJANGO_INSTALL="Django==1.4.10"
- python: "2.6"
env: DJANGO_INSTALL="Django==1.6.1"
- pip install tox
script:
- tox -e $TOX_ENV
17 changes: 14 additions & 3 deletions README.rst
Expand Up @@ -150,14 +150,25 @@ for me and contributors should include:
Please use the project's issues tracker to report bugs, doc updates, or other
requests/suggestions.

Targets
-------
Targets & testing
-----------------

The codebase is targeted at tested against:

* Django 1.4.x against Python 2.6 and Python 2.7
* Django 1.5.x against Python 2.6, Python 2.7, and Python 3.3
* Django 1.6.x (beta) against Python 2.7 and Python 3.3
* Django 1.6.x against Python 2.7 and Python 3.3

You can run the tests from the example project using the simple wrapper script:

./runtests.sh

To run tests against all target environments, install `tox
<https://testrun.org/tox/latest/>`_ and then execute the command:

tox

Yes, that's it.

Submitting
----------
Expand Down
2 changes: 1 addition & 1 deletion example/grouptest/settings.py
Expand Up @@ -109,7 +109,7 @@
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(PROJECT_ROOT, 'templates/')
os.path.join(PROJECT_ROOT, 'templates/'),
)

TEMPLATE_CONTEXT_PROCESSORS = (
Expand Down
47 changes: 47 additions & 0 deletions tox.ini
@@ -0,0 +1,47 @@
[tox]
envlist = py26-django14, py26-django15, py26-django16, py27-django14, py27-django15, py27-django16, py27-django15, py33-django16

[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/organizations
commands = ./runtests.sh

[testenv:py26-django14]
basepython = python2.6
deps =
Django>=1.4,<1.5

[testenv:py26-django15]
basepython = python2.6
deps =
Django>=1.5,<1.6

[testenv:py26-django16]
basepython = python2.6
deps =
Django>=1.6,<1.7

[testenv:py27-django14]
basepython = python2.6
deps =
Django>=1.4,<1.5

[testenv:py27-django15]
basepython = python2.6
deps =
Django>=1.5,<1.6

[testenv:py27-django16]
basepython = python2.6
deps =
Django>=1.6,<1.7

[testenv:py33-django15]
basepython = python3.3
deps =
Django>=1.5,<1.6

[testenv:py33-django16]
basepython = python3.3
deps =
Django>=1.6,<1.7

0 comments on commit a55dbf5

Please sign in to comment.