]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-139208: Fix regrtest --fast-ci --verbose (GH-139240) (#139260)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 7 Oct 2025 17:39:06 +0000 (19:39 +0200)
committerGitHub <noreply@github.com>
Tue, 7 Oct 2025 17:39:06 +0000 (19:39 +0200)
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 b2daeadc7e7278ae1e571733f5cdd9b8ece6ebf8..e7a12e4d0b6d579482b9b820636211af7452f972 100644 (file)
@@ -464,7 +464,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 083516808be30b67eeb0344119c912dcff8992fe..220b1ebcd7bc1f138f72c983f399d0847623bb99 100644 (file)
@@ -448,7 +448,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)
@@ -457,7 +458,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
 
@@ -484,6 +485,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.