]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-139208: Fix regrtest --fast-ci --verbose (GH-139240) (#139261)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 23 Sep 2025 14:32:19 +0000 (16:32 +0200)
committerGitHub <noreply@github.com>
Tue, 23 Sep 2025 14:32:19 +0000 (14:32 +0000)
gh-139208: Fix regrtest --fast-ci --verbose (GH-139240)

Don't ignore the --verbose option anymore.
(cherry picked from commit dd683f8f341dd0c95ac4f1363d92d141ea5b3842)

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/test/libregrtest/cmdline.py
Lib/test/test_regrtest.py
Misc/NEWS.d/next/Tests/2025-09-22-15-40-09.gh-issue-139208.Tc13dl.rst [new file with mode: 0644]

index 4647c83a08301b22ecd73fa95f1e79f411574130..62bc36ed42171a7746f587aeffb0448476396a94 100644 (file)
@@ -437,7 +437,11 @@ def _parse_args(args, **kwargs):
         if ns.python is None:
             ns.rerun = True
         ns.print_slow = True
-        ns.verbose3 = True
+        if not ns.verbose:
+            ns.verbose3 = True
+        else:
+            # --verbose has the priority over --verbose3
+            pass
     else:
         ns._add_python_opts = False
 
index be1b0cd517aed6eb5829a8aa3a37eab0f0d25d60..a95a13436fc9975e71ca83302c6d17380766aff4 100644 (file)
@@ -445,7 +445,8 @@ class ParseArgsTestCase(unittest.TestCase):
 
         return regrtest
 
-    def check_ci_mode(self, args, use_resources, *, rerun=True, randomize=True):
+    def check_ci_mode(self, args, use_resources,
+                      *, rerun=True, randomize=True, output_on_failure=True):
         regrtest = self.create_regrtest(args)
         self.assertEqual(regrtest.num_workers, -1)
         self.assertEqual(regrtest.want_rerun, rerun)
@@ -454,7 +455,7 @@ class ParseArgsTestCase(unittest.TestCase):
         self.assertIsInstance(regrtest.random_seed, int)
         self.assertTrue(regrtest.fail_env_changed)
         self.assertTrue(regrtest.print_slowest)
-        self.assertTrue(regrtest.output_on_failure)
+        self.assertEqual(regrtest.output_on_failure, output_on_failure)
         self.assertEqual(sorted(regrtest.use_resources), sorted(use_resources))
         return regrtest
 
@@ -481,6 +482,14 @@ class ParseArgsTestCase(unittest.TestCase):
         use_resources.remove('network')
         self.check_ci_mode(args, use_resources)
 
+    def test_fast_ci_verbose(self):
+        args = ['--fast-ci', '--verbose']
+        use_resources = sorted(cmdline.ALL_RESOURCES)
+        use_resources.remove('cpu')
+        regrtest = self.check_ci_mode(args, use_resources,
+                                      output_on_failure=False)
+        self.assertEqual(regrtest.verbose, True)
+
     def test_slow_ci(self):
         args = ['--slow-ci']
         use_resources = sorted(cmdline.ALL_RESOURCES)
diff --git a/Misc/NEWS.d/next/Tests/2025-09-22-15-40-09.gh-issue-139208.Tc13dl.rst b/Misc/NEWS.d/next/Tests/2025-09-22-15-40-09.gh-issue-139208.Tc13dl.rst
new file mode 100644 (file)
index 0000000..b8672ac
--- /dev/null
@@ -0,0 +1,2 @@
+Fix regrtest ``--fast-ci --verbose``: don't ignore the ``--verbose`` option
+anymore. Patch by Victor Stinner.