Permalink
Browse files

Django 1.6 test runner rules adopted.

  • Loading branch information...
1 parent edd527e commit 28e89c18b4272b11074873c3f43bcaace0efcec0 @idlesign committed Dec 12, 2013
Showing with 35 additions and 10 deletions.
  1. +22 −8 sitemetrics/runtests.py
  2. +13 −2 tox.ini
View
@@ -1,14 +1,28 @@
-#!/usr/bin/env python
+#! /usr/bin/env python
+import sys
+import os
+
from django.conf import settings
-from django.core.management import call_command
-if not settings.configured:
- settings.configure(
- INSTALLED_APPS=( 'django.contrib.sites', 'sitemetrics'),
- DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3'}},
- )
+APP_NAME = 'sitemetrics'
+
+
+def main():
+ sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
+
+ if not settings.configured:
+ settings.configure(
+ INSTALLED_APPS=( 'django.contrib.sites', APP_NAME),
+ DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3'}},
+ )
+
+ from django.test.utils import get_runner
+ runner = get_runner(settings)()
+ failures = runner.run_tests((APP_NAME,))
+
+ sys.exit(failures)
if __name__ == '__main__':
- call_command('test', 'sitemetrics')
+ main()
View
15 tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py27-django13, py27-django14, py27-django15, py33-django15
+envlist = py27-django13, py27-django14, py27-django15, py33-django15, py27-django16, py33-django16
[django13]
deps = Django>=1.3,<1.4
@@ -8,7 +8,10 @@ deps = Django>=1.3,<1.4
deps = Django>=1.4,<1.5
[django15]
-deps = Django>=1.5
+deps = Django>=1.5,<1.6
+
+[django16]
+deps = Django>=1.6,<1.7
[testenv]
commands = python sitemetrics/runtests.py
@@ -25,6 +28,14 @@ deps = {[django14]deps}
basepython = python2.7
deps = {[django15]deps}
+[testenv:py27-django16]
+basepython = python2.7
+deps = {[django16]deps}
+
[testenv:py33-django15]
basepython = python3.3
deps = {[django15]deps}
+
+[testenv:py33-django16]
+basepython = python3.3
+deps = {[django16]deps}

0 comments on commit 28e89c1

Please sign in to comment.