Commits

Carl Meyer committed 0750050

Add support for Django master (1.8) in runtests.py.

Comments (0)

Files changed (2)

 
 
 def runtests(*test_args):
-    if not test_args:
-        test_args = ['tests']
     parent = dirname(abspath(__file__))
     sys.path.insert(0, parent)
     try:
-        from django.test.simple import DjangoTestSuiteRunner
+        from django.test.runner import DiscoverRunner
+
         def run_tests(test_args, verbosity, interactive):
-            runner = DjangoTestSuiteRunner(
+            runner = DiscoverRunner(
                 verbosity=verbosity, interactive=interactive, failfast=False)
             return runner.run_tests(test_args)
     except ImportError:
-        # for Django versions that don't have DjangoTestSuiteRunner
-        from django.test.simple import run_tests
+        if not test_args:
+            test_args = ['tests']
+        try:
+            from django.test.simple import DjangoTestSuiteRunner
+
+            def run_tests(test_args, verbosity, interactive):
+                runner = DjangoTestSuiteRunner(
+                    verbosity=verbosity, interactive=interactive, failfast=False)
+                return runner.run_tests(test_args)
+        except ImportError:
+            from django.test.simple import run_tests
     failures = run_tests(
         test_args, verbosity=1, interactive=True)
     sys.exit(failures)
 [tox]
 envlist=
   py26-1.3,py26-1.4,py26-1.5,py26-1.6,
-  py27-1.3,py27-1.4,py27-1.5,py27-1.6,py27-1.7
+  py27-1.3,py27-1.4,py27-1.5,py27-1.6,py27-1.7,py27-master
 
 [testenv]
 commands=python setup.py test
 basepython=python2.7
 deps=
   https://github.com/django/django/tarball/stable/1.7.x
+
+[testenv:py27-master]
+basepython=python2.7
+deps=
+  https://github.com/django/django/tarball/master