Issue #10347: ignore leading test count ("[ 1/340]") when using the -f option to regrtest.

This commit is contained in:
Antoine Pitrou 2010-11-07 20:50:51 +00:00
parent c911bbfd5d
commit d95c7b5f8a

View file

@ -424,7 +424,9 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
if fromfile:
tests = []
fp = open(os.path.join(support.SAVEDCWD, fromfile))
count_pat = re.compile(r'\[\s*\d+/\s*\d+\]')
for line in fp:
line = count_pat.sub('', line)
guts = line.split() # assuming no test has whitespace in its name
if guts and not guts[0].startswith('#'):
tests.extend(guts)