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 50e6eb32817700..c27b3c862924d1 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.