Skip to content

Commit 3014572

Browse files
committed
fix: use raw text and compile regex
1 parent de4e4d0 commit 3014572

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tools/test.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
from Queue import Queue, Empty
5050

5151
logger = logging.getLogger('testrunner')
52+
is_skipped = re.compile(r"# SKIP\S+ (.+)", re.IGNORECASE)
5253

5354
VERBOSE = False
5455

@@ -256,8 +257,7 @@ def HasRun(self, output):
256257
for l in output.output.stdout.splitlines():
257258
logger.info('#' + l)
258259
elif output.HasSkipped():
259-
skip = re.findall('# SKIP\S+ (.+)', output.output.stdout,
260-
re.IGNORECASE)
260+
skip = is_skipped.findall(output.output.stdout)
261261
logger.info('ok %i - %s # skip %s' % (self._done, command, skip[0]))
262262
else:
263263
logger.info('ok %i - %s' % (self._done, command))
@@ -476,8 +476,7 @@ def UnexpectedOutput(self):
476476
return not outcome in self.test.outcomes
477477

478478
def HasSkipped(self):
479-
skip = re.search('# SKIP\S+ (.+)', self.output.stdout,
480-
re.IGNORECASE)
479+
skip = is_skipped.search(self.output.stdout)
481480
return self.store_unexpected_output and skip
482481

483482
def HasPreciousOutput(self):

0 commit comments

Comments
 (0)