Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Removed deprecated DjangoTestRunner.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17840 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c7229c681e648ea810e907784855eb91d47a7bfb 1 parent 3f16506
Aymeric Augustin authored March 31, 2012
13  django/test/simple.py
@@ -10,7 +10,7 @@
10 10
 from django.utils.importlib import import_module
11 11
 from django.utils.module_loading import module_has_submodule
12 12
 
13  
-__all__ = ('DjangoTestRunner', 'DjangoTestSuiteRunner')
  13
+__all__ = ('DjangoTestSuiteRunner')
14 14
 
15 15
 # The module name for tests outside models.py
16 16
 TEST_MODULE = 'tests'
@@ -18,17 +18,6 @@
18 18
 doctestOutputChecker = OutputChecker()
19 19
 
20 20
 
21  
-class DjangoTestRunner(unittest.TextTestRunner):
22  
-    def __init__(self, *args, **kwargs):
23  
-        import warnings
24  
-        warnings.warn(
25  
-            "DjangoTestRunner is deprecated; it's functionality is "
26  
-            "indistinguishable from TextTestRunner",
27  
-            DeprecationWarning
28  
-        )
29  
-        super(DjangoTestRunner, self).__init__(*args, **kwargs)
30  
-
31  
-
32 21
 def get_tests(app_module):
33 22
     parts = app_module.__name__.split('.')
34 23
     prefix, last = parts[:-1], parts[-1]
29  tests/regressiontests/test_runner/tests.py
@@ -24,35 +24,6 @@
24 24
 TEST_APP_ERROR = 'regressiontests.test_runner.invalid_app.models'
25 25
 
26 26
 
27  
-class DjangoTestRunnerTests(unittest.TestCase):
28  
-    def setUp(self):
29  
-        self._warnings_state = get_warnings_state()
30  
-        warnings.filterwarnings('ignore', category=DeprecationWarning,
31  
-                                module='django.test.simple')
32  
-
33  
-    def tearDown(self):
34  
-        restore_warnings_state(self._warnings_state)
35  
-
36  
-    def test_failfast(self):
37  
-        class MockTestOne(unittest.TestCase):
38  
-            def runTest(self):
39  
-                assert False
40  
-        class MockTestTwo(unittest.TestCase):
41  
-            def runTest(self):
42  
-                assert False
43  
-
44  
-        suite = unittest.TestSuite([MockTestOne(), MockTestTwo()])
45  
-        mock_stream = StringIO.StringIO()
46  
-        dtr = simple.DjangoTestRunner(verbosity=0, failfast=False, stream=mock_stream)
47  
-        result = dtr.run(suite)
48  
-        self.assertEqual(2, result.testsRun)
49  
-        self.assertEqual(2, len(result.failures))
50  
-
51  
-        dtr = simple.DjangoTestRunner(verbosity=0, failfast=True, stream=mock_stream)
52  
-        result = dtr.run(suite)
53  
-        self.assertEqual(1, result.testsRun)
54  
-        self.assertEqual(1, len(result.failures))
55  
-
56 27
 class DependencyOrderingTests(unittest.TestCase):
57 28
 
58 29
     def test_simple_dependencies(self):

0 notes on commit c7229c6

Please sign in to comment.
Something went wrong with that request. Please try again.