1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #16534 -- Improved ability to customize DiscoverRunner

Added DiscoverRunner.test_suite and .test_runner attributes.

Thanks tomchristie for the suggestion and jcd for the patch.
This commit is contained in:
Tim Graham
2013-09-10 09:49:39 -04:00
parent fca4c4826e
commit 4ba373840a
4 changed files with 45 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
from contextlib import contextmanager
import os
import sys
from unittest import expectedFailure
from unittest import expectedFailure, TestSuite, TextTestRunner, defaultTestLoader
from django.test import TestCase
from django.test.runner import DiscoverRunner
@@ -68,3 +68,12 @@ class DiscoverRunnerTest(TestCase):
).countTestCases()
self.assertEqual(count, 3)
def test_overrideable_test_suite(self):
self.assertEqual(DiscoverRunner().test_suite, TestSuite)
def test_overrideable_test_runner(self):
self.assertEqual(DiscoverRunner().test_runner, TextTestRunner)
def test_overrideable_test_loader(self):
self.assertEqual(DiscoverRunner().test_loader, defaultTestLoader)