mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
bpo-33873: Fix bug in runtest.py and add checks for invalid -R parameters (GH-7735)
Fix bug in `Lib/test/libregrtest/runtest.py` that makes running tests an extra time than the specified number of runs. Add check for invalid --huntrleaks/-R parameters.
This commit is contained in:
parent
866c168a5f
commit
58ed7307ea
3 changed files with 15 additions and 1 deletions
|
|
@ -533,6 +533,15 @@ class Regrtest:
|
|||
def _main(self, tests, kwargs):
|
||||
self.ns = self.parse_args(kwargs)
|
||||
|
||||
if self.ns.huntrleaks:
|
||||
warmup, repetitions, _ = self.ns.huntrleaks
|
||||
if warmup < 1 or repetitions < 1:
|
||||
msg = ("Invalid values for the --huntrleaks/-R parameters. The "
|
||||
"number of warmups and repetitions must be at least 1 "
|
||||
"each (1:1).")
|
||||
print(msg, file=sys.stderr, flush=True)
|
||||
sys.exit(2)
|
||||
|
||||
if self.ns.slaveargs is not None:
|
||||
from test.libregrtest.runtest_mp import run_tests_slave
|
||||
run_tests_slave(self.ns.slaveargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue