Browse Source

Refs #32641 -- Made DiscoverRunner's "Found X tests" message work for finding one test.

This also removes passing level to log() as logging.INFO is the default.
Chris Jerdonek 3 years ago
parent
commit
1b4d1675b2
2 changed files with 2 additions and 2 deletions
  1. 1 1
      django/test/runner.py
  2. 1 1
      tests/test_runner/test_discover_runner.py

+ 1 - 1
django/test/runner.py

@@ -669,7 +669,7 @@ class DiscoverRunner:
         # found or that couldn't be loaded due to syntax errors.
         test_types = (unittest.loader._FailedTest, *self.reorder_by)
         all_tests = list(reorder_tests(all_tests, test_types, self.reverse))
-        self.log('Found %d tests.' % len(all_tests), level=logging.INFO)
+        self.log('Found %d test(s).' % len(all_tests))
         suite = self.test_suite(all_tests)
 
         if self.parallel > 1:

+ 1 - 1
tests/test_runner/test_discover_runner.py

@@ -306,7 +306,7 @@ class DiscoverRunnerTests(SimpleTestCase):
                 'test_runner_apps.sample.tests_sample.TestDjangoTestCase',
                 'test_runner_apps.simple',
             ])
-            self.assertIn('Found 14 tests.\n', stdout.getvalue())
+            self.assertIn('Found 14 test(s).\n', stdout.getvalue())
 
     def test_pdb_with_parallel(self):
         msg = (