Skip to content

Commit 8d5dada

Browse files
vstinnermiss-islington
authored andcommitted
gh-139208: Fix regrtest --fast-ci --verbose (GH-139240)
Don't ignore the --verbose option anymore. (cherry picked from commit dd683f8) Co-authored-by: Victor Stinner <[email protected]>
1 parent 460ad1a commit 8d5dada

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

Lib/test/libregrtest/cmdline.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,11 @@ def _parse_args(args, **kwargs):
464464
if ns.python is None:
465465
ns.rerun = True
466466
ns.print_slow = True
467-
ns.verbose3 = True
467+
if not ns.verbose:
468+
ns.verbose3 = True
469+
else:
470+
# --verbose has the priority over --verbose3
471+
pass
468472
else:
469473
ns._add_python_opts = False
470474

Lib/test/test_regrtest.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,8 @@ def create_regrtest(self, args):
448448

449449
return regrtest
450450

451-
def check_ci_mode(self, args, use_resources, *, rerun=True, randomize=True):
451+
def check_ci_mode(self, args, use_resources,
452+
*, rerun=True, randomize=True, output_on_failure=True):
452453
regrtest = self.create_regrtest(args)
453454
self.assertEqual(regrtest.num_workers, -1)
454455
self.assertEqual(regrtest.want_rerun, rerun)
@@ -457,7 +458,7 @@ def check_ci_mode(self, args, use_resources, *, rerun=True, randomize=True):
457458
self.assertIsInstance(regrtest.random_seed, int)
458459
self.assertTrue(regrtest.fail_env_changed)
459460
self.assertTrue(regrtest.print_slowest)
460-
self.assertTrue(regrtest.output_on_failure)
461+
self.assertEqual(regrtest.output_on_failure, output_on_failure)
461462
self.assertEqual(sorted(regrtest.use_resources), sorted(use_resources))
462463
return regrtest
463464

@@ -484,6 +485,14 @@ def test_fast_ci_resource(self):
484485
use_resources.remove('network')
485486
self.check_ci_mode(args, use_resources)
486487

488+
def test_fast_ci_verbose(self):
489+
args = ['--fast-ci', '--verbose']
490+
use_resources = sorted(cmdline.ALL_RESOURCES)
491+
use_resources.remove('cpu')
492+
regrtest = self.check_ci_mode(args, use_resources,
493+
output_on_failure=False)
494+
self.assertEqual(regrtest.verbose, True)
495+
487496
def test_slow_ci(self):
488497
args = ['--slow-ci']
489498
use_resources = sorted(cmdline.ALL_RESOURCES)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix regrtest ``--fast-ci --verbose``: don't ignore the ``--verbose`` option
2+
anymore. Patch by Victor Stinner.

0 commit comments

Comments
 (0)