tools/extracttests.py: test code was not extracted properly for some tests (#5776)
This commit is contained in:
parent
2932ab7592
commit
34fb24d5a9
|
@ -94,8 +94,7 @@ class Extract:
|
|||
start_code = None
|
||||
disable = False
|
||||
|
||||
fin = open(filename, 'r')
|
||||
for line in fin:
|
||||
for line in open(filename, 'r'):
|
||||
# testclass starts
|
||||
res = re.match('class (' + name + ')', line)
|
||||
if res is not None:
|
||||
|
@ -137,6 +136,10 @@ class Extract:
|
|||
if code is not None:
|
||||
res = re.match('\\s+' + string, line)
|
||||
if res is not None:
|
||||
if line.find('",') > line.find('"'):
|
||||
code = None
|
||||
continue
|
||||
|
||||
code = code + res.group(1)
|
||||
if res.group(1).find('"') > 0:
|
||||
code = None
|
||||
|
@ -159,10 +162,8 @@ class Extract:
|
|||
'expected': expected}
|
||||
self.nodes.append(node)
|
||||
code = None
|
||||
|
||||
# close test file
|
||||
fin.close()
|
||||
|
||||
elif re.match('\\s+[TOD_]*ASSERT', line) is not None:
|
||||
code = None
|
||||
|
||||
def strtoxml(s):
|
||||
"""Convert string to xml/html format"""
|
||||
|
|
Loading…
Reference in New Issue