From 1b4d1675b230cd6d47c2ffce41893d1881bf447b Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Wed, 2 Jun 2021 03:53:09 -0700 Subject: [PATCH] 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. --- django/test/runner.py | 2 +- tests/test_runner/test_discover_runner.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/django/test/runner.py b/django/test/runner.py index dea3703d89..39900435e7 100644 --- a/django/test/runner.py +++ b/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: diff --git a/tests/test_runner/test_discover_runner.py b/tests/test_runner/test_discover_runner.py index d4ec6e97e1..692575b028 100644 --- a/tests/test_runner/test_discover_runner.py +++ b/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 = (