Skip to content

Commit

Permalink
tools/extracttests.py: test code was not extracted properly for some …
Browse files Browse the repository at this point in the history
…tests (#5776)
  • Loading branch information
danmar committed Dec 17, 2023
1 parent 2932ab7 commit 34fb24d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tools/extracttests.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ def parseFile(self, filename):
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:
Expand Down Expand Up @@ -137,6 +136,10 @@ def parseFile(self, filename):
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
Expand All @@ -159,10 +162,8 @@ def parseFile(self, filename):
'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"""
Expand Down

0 comments on commit 34fb24d

Please sign in to comment.