https://github.com/python/cpython/commit/e4e8c5a3b0f51fd403ee7deaa9187010a52f44e8
commit: e4e8c5a3b0f51fd403ee7deaa9187010a52f44e8
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: vstinner <[email protected]>
date: 2025-10-07T19:39:06+02:00
summary:

[3.14] gh-139208: Fix regrtest --fast-ci --verbose (GH-139240) (#139260)

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 <[email protected]>

files:
A Misc/NEWS.d/next/Tests/2025-09-22-15-40-09.gh-issue-139208.Tc13dl.rst
M Lib/test/libregrtest/cmdline.py
M Lib/test/test_regrtest.py

diff --git a/Lib/test/libregrtest/cmdline.py b/Lib/test/libregrtest/cmdline.py
index b2daeadc7e7278..e7a12e4d0b6d57 100644
--- a/Lib/test/libregrtest/cmdline.py
+++ b/Lib/test/libregrtest/cmdline.py
@@ -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
 
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
index 083516808be30b..220b1ebcd7bc1f 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -448,7 +448,8 @@ def create_regrtest(self, args):
 
         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 @@ def check_ci_mode(self, args, use_resources, *, rerun=True, 
randomize=True):
         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 @@ def test_fast_ci_resource(self):
         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
index 00000000000000..b8672ac83e1ead
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2025-09-22-15-40-09.gh-issue-139208.Tc13dl.rst
@@ -0,0 +1,2 @@
+Fix regrtest ``--fast-ci --verbose``: don't ignore the ``--verbose`` option
+anymore. Patch by Victor Stinner.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to