mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Refs #31811 -- Added optional timing outputs to the test runner.
This commit is contained in:
committed by
Carlton Gibson
parent
21768a99f4
commit
61a0ba43cf
@@ -14,7 +14,7 @@ from django.core.management.base import SystemCheckError
|
||||
from django.test import TransactionTestCase, skipUnlessDBFeature, testcases
|
||||
from django.test.runner import DiscoverRunner
|
||||
from django.test.testcases import connections_support_transactions
|
||||
from django.test.utils import dependency_ordered
|
||||
from django.test.utils import captured_stderr, dependency_ordered
|
||||
|
||||
from .models import B, Person, Through
|
||||
|
||||
@@ -148,6 +148,11 @@ class ManageCommandTests(unittest.TestCase):
|
||||
with self.assertRaises(AttributeError):
|
||||
call_command('test', 'sites', testrunner='test_runner.NonexistentRunner')
|
||||
|
||||
def test_time_recorded(self):
|
||||
with captured_stderr() as stderr:
|
||||
call_command('test', '--timing', 'sites', testrunner='test_runner.tests.MockTestRunner')
|
||||
self.assertIn('Total run took', stderr.getvalue())
|
||||
|
||||
|
||||
class CustomTestRunnerOptionsSettingsTests(AdminScriptTestCase):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user