Kaydet (Commit) 6c44619e authored tarafından Victor Stinner's avatar Victor Stinner

regrtest: rename --slow option to --slowest

Thanks to optparse, --slow syntax still works ;-)
üst 717a32b7
...@@ -168,7 +168,7 @@ def _create_parser(): ...@@ -168,7 +168,7 @@ def _create_parser():
help='display test output on failure') help='display test output on failure')
group.add_argument('-q', '--quiet', action='store_true', group.add_argument('-q', '--quiet', action='store_true',
help='no output unless one or more tests fail') help='no output unless one or more tests fail')
group.add_argument('-o', '--slow', action='store_true', dest='print_slow', group.add_argument('-o', '--slowest', action='store_true', dest='print_slow',
help='print the slowest 10 tests') help='print the slowest 10 tests')
group.add_argument('--header', action='store_true', group.add_argument('--header', action='store_true',
help='print header with interpreter info') help='print header with interpreter info')
......
...@@ -109,7 +109,7 @@ class ParseArgsTestCase(unittest.TestCase): ...@@ -109,7 +109,7 @@ class ParseArgsTestCase(unittest.TestCase):
self.assertEqual(ns.verbose, 0) self.assertEqual(ns.verbose, 0)
def test_slow(self): def test_slow(self):
for opt in '-o', '--slow': for opt in '-o', '--slowest':
with self.subTest(opt=opt): with self.subTest(opt=opt):
ns = libregrtest._parse_args([opt]) ns = libregrtest._parse_args([opt])
self.assertTrue(ns.print_slow) self.assertTrue(ns.print_slow)
...@@ -661,9 +661,9 @@ class ArgsTestCase(BaseTestCase): ...@@ -661,9 +661,9 @@ class ArgsTestCase(BaseTestCase):
self.check_executed_tests(output, test, omitted=test) self.check_executed_tests(output, test, omitted=test)
def test_slow(self): def test_slow(self):
# test --slow # test --slowest
tests = [self.create_test() for index in range(3)] tests = [self.create_test() for index in range(3)]
output = self.run_tests("--slow", *tests) output = self.run_tests("--slowest", *tests)
self.check_executed_tests(output, tests) self.check_executed_tests(output, tests)
regex = ('10 slowest tests:\n' regex = ('10 slowest tests:\n'
'(?:%s: [0-9]+\.[0-9]+s\n){%s}' '(?:%s: [0-9]+\.[0-9]+s\n){%s}'
...@@ -671,15 +671,15 @@ class ArgsTestCase(BaseTestCase): ...@@ -671,15 +671,15 @@ class ArgsTestCase(BaseTestCase):
self.check_line(output, regex) self.check_line(output, regex)
def test_slow_interrupted(self): def test_slow_interrupted(self):
# Issue #25373: test --slow with an interrupted test # Issue #25373: test --slowest with an interrupted test
code = TEST_INTERRUPTED code = TEST_INTERRUPTED
test = self.create_test("sigint", code=code) test = self.create_test("sigint", code=code)
for multiprocessing in (False, True): for multiprocessing in (False, True):
if multiprocessing: if multiprocessing:
args = ("--slow", "-j2", test) args = ("--slowest", "-j2", test)
else: else:
args = ("--slow", test) args = ("--slowest", test)
output = self.run_tests(*args, exitcode=1) output = self.run_tests(*args, exitcode=1)
self.check_executed_tests(output, test, omitted=test) self.check_executed_tests(output, test, omitted=test)
regex = ('10 slowest tests:\n') regex = ('10 slowest tests:\n')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment