Skip to content

Commit

Permalink
Added test ordering to the django test runner, so it behaves the same…
Browse files Browse the repository at this point in the history
… way as the original.
  • Loading branch information
lukasz committed Aug 9, 2012
1 parent ced7eec commit 531f268
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/xmlrunner/extra/djangotestrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@

from django.db.models import get_app, get_apps
from django.test.utils import setup_test_environment, teardown_test_environment
from django.test.simple import build_suite, build_test, DjangoTestSuiteRunner
from django.test.simple import (
build_suite, build_test, DjangoTestSuiteRunner, reorder_suite
)
from django.test.testcases import TestCase
import xmlrunner

class XMLTestRunner(DjangoTestSuiteRunner):
Expand Down Expand Up @@ -63,6 +66,8 @@ def run_tests(self, test_labels, verbosity=1, interactive=True, extra_tests=[]):
for test in extra_tests:
suite.addTest(test)

suite = reorder_suite(suite, (TestCase,))

old_config = self.setup_databases()

result = xmlrunner.XMLTestRunner(
Expand Down

0 comments on commit 531f268

Please sign in to comment.