Permalink
Browse files

Improving test infrastructure and also testing with Django 1.6

  • Loading branch information...
1 parent 30eaff3 commit 0aa54a8ca2342e50e47f9b24074c4fa1620194b4 @gregmuellegger committed Jan 16, 2014
Showing with 70 additions and 20 deletions.
  1. +4 −0 .travis.yml
  2. +22 −5 runtests.py
  3. +0 −1 test_settings.py
  4. +44 −14 tox.ini
View
@@ -2,12 +2,16 @@ language: python
env:
- TOX_ENV=py26-1.4
- TOX_ENV=py26-1.5
+ - TOX_ENV=py26-1.6
- TOX_ENV=py27-1.4
- TOX_ENV=py27-1.5
+ - TOX_ENV=py27-1.6
- TOX_ENV=pypy-1.4
- TOX_ENV=pypy-1.5
+ - TOX_ENV=pypy-1.6
- TOX_ENV=py32-1.5
- TOX_ENV=py33-1.5
+ - TOX_ENV=py33-1.6
before_install:
- export PIP_USE_MIRRORS=true
- export PIP_INDEX_URL=https://simple.crate.io/
View
@@ -7,20 +7,37 @@
parent = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, parent)
-sys.path.insert(0, os.path.join(parent, 'test_project'))
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project.settings")
+
+import django
from django.core.management import call_command
-def runtests(*args):
- test_apps = args or [
+if django.VERSION < (1, 6):
+ default_test_apps = [
'sortedm2m_tests',
'sortedm2m_field',
'sortedm2m_form',
'south_support',
+ 'south_support_new_model',
+ 'south_support_new_field',
+ 'south_support_custom_sort_field_name',
+ ]
+else:
+ default_test_apps = [
+ 'sortedm2m_tests.sortedm2m_field',
+ 'sortedm2m_tests.sortedm2m_form',
+ 'sortedm2m_tests.south_support',
+ 'sortedm2m_tests.south_support.south_support_new_model',
+ 'sortedm2m_tests.south_support.south_support_new_field',
+ 'sortedm2m_tests.south_support.south_support_custom_sort_field_name',
]
- call_command('test', *test_apps)
+
+
+def runtests(*args):
+ test_apps = args or default_test_apps
+ call_command('test', *test_apps, verbosity=1)
if __name__ == '__main__':
View
@@ -1 +0,0 @@
-from test_project.settings import *
View
58 tox.ini
@@ -1,65 +1,95 @@
[tox]
envlist =
- py26-1.4, py26-1.5,
- py27-1.4, py27-1.5,
- py32-1.5,
- py33-1.5,
- pypy-1.4, pypy-1.5
+ py26-1.4, py26-1.5, py26-1.6,
+ py27-1.4, py27-1.5, py27-1.6,
+ py32-1.5, py32-1.6,
+ py33-1.5, py33-1.6,
+ pypy-1.4, pypy-1.5, pypy-1.6
[testenv]
commands = python runtests.py
install_command = pip install {opts} {packages}
setenv =
- DJANGO_SETTINGS_MODULE = test_settings
+ DJANGO_SETTINGS_MODULE = test_project.settings
[testenv:py26-1.4]
basepython = python2.6
deps =
- Django==1.4.5
+ Django >=1.4, <1.4.99
-r{toxinidir}/requirements/tests.txt
[testenv:py26-1.5]
basepython = python2.6
deps =
- Django==1.5.1
+ Django >=1.5, <1.5.99
+ -r{toxinidir}/requirements/tests.txt
+
+[testenv:py26-1.6]
+basepython = python2.6
+deps =
+ Django >=1.6, <1.6.99
-r{toxinidir}/requirements/tests.txt
[testenv:py27-1.4]
basepython = python2.7
deps =
- Django==1.4.5
+ Django >=1.4, <1.4.99
-r{toxinidir}/requirements/tests.txt
[testenv:py27-1.5]
basepython = python2.7
deps =
- Django==1.5.1
+ Django >=1.5, <1.5.99
+ -r{toxinidir}/requirements/tests.txt
+
+[testenv:py27-1.6]
+basepython = python2.7
+deps =
+ Django >=1.6, <1.6.99
-r{toxinidir}/requirements/tests.txt
[testenv:py32-1.5]
basepython = python3.2
deps =
- Django==1.5.1
+ Django >=1.5, <1.5.99
argparse
mock
https://bitbucket.org/andrewgodwin/south/get/default.tar.gz#egg=South
+[testenv:py32-1.6]
+basepython = python3.2
+deps =
+ Django >=1.6, <1.6.99
+ -r{toxinidir}/requirements/tests.txt
+
[testenv:py33-1.5]
basepython = python3.3
deps =
- Django==1.5.1
+ Django >=1.5, <1.5.99
argparse
mock
https://bitbucket.org/andrewgodwin/south/get/default.tar.gz#egg=South
+[testenv:py33-1.6]
+basepython = python3.3
+deps =
+ Django >=1.6, <1.6.99
+ -r{toxinidir}/requirements/tests.txt
+
[testenv:pypy-1.4]
basepython = pypy
deps =
- Django==1.4.5
+ Django >=1.4, <1.4.99
-r{toxinidir}/requirements/tests.txt
[testenv:pypy-1.5]
basepython = pypy
deps =
- Django==1.5.1
+ Django >=1.5, <1.5.99
+ -r{toxinidir}/requirements/tests.txt
+
+[testenv:pypy-1.6]
+basepython = pypy
+deps =
+ Django >=1.6, <1.6.99
-r{toxinidir}/requirements/tests.txt

0 comments on commit 0aa54a8

Please sign in to comment.