mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
regrtest: display test duration in sequential mode
Only display duration if a test takes more than 30 seconds.
This commit is contained in:
parent
e985726553
commit
69649f21f0
4 changed files with 29 additions and 9 deletions
|
|
@ -304,7 +304,7 @@ class ParseArgsTestCase(unittest.TestCase):
|
|||
class BaseTestCase(unittest.TestCase):
|
||||
TEST_UNIQUE_ID = 1
|
||||
TESTNAME_PREFIX = 'test_regrtest_'
|
||||
TESTNAME_REGEX = r'test_[a-z0-9_]+'
|
||||
TESTNAME_REGEX = r'test_[a-zA-Z0-9_]+'
|
||||
|
||||
def setUp(self):
|
||||
self.testdir = os.path.realpath(os.path.dirname(__file__))
|
||||
|
|
@ -351,7 +351,8 @@ class BaseTestCase(unittest.TestCase):
|
|||
self.assertRegex(output, regex)
|
||||
|
||||
def parse_executed_tests(self, output):
|
||||
regex = r'^[0-9]+:[0-9]+:[0-9]+ \[ *[0-9]+(?:/ *[0-9]+)?\] (%s)$' % self.TESTNAME_REGEX
|
||||
regex = (r'^[0-9]+:[0-9]+:[0-9]+ \[ *[0-9]+(?:/ *[0-9]+)?\] (%s)'
|
||||
% self.TESTNAME_REGEX)
|
||||
parser = re.finditer(regex, output, re.MULTILINE)
|
||||
return list(match.group(1) for match in parser)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue