Skip to content

Instantly share code, notes, and snippets.

@streeter streeter/ forked from carljm/
Created Dec 9, 2011

What would you like to do?
Unittest2 test discovery and real dotted-path named test selection for Django
from django.conf import settings
from django.test.simple import DjangoTestSuiteRunner, reorder_suite
from django.utils.unittest import TestCase
from django.utils.unittest.loader import defaultTestLoader
class DiscoveryDjangoTestSuiteRunner(DjangoTestSuiteRunner):
def build_suite(self, test_labels, extra_tests=None, **kwargs):
if test_labels:
return super(DiscoveryDjangoTestSuiteRunner, self).build_suite(test_labels, extra_tests=extra_tests, **kwargs)
suite =
if extra_tests:
for test in extra_tests:
return reorder_suite(suite, (TestCase,))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.