Skip to content
Permalink
Browse files

Apply suggestions from code review

Co-authored-by: Denis Rouzaud <denis.rouzaud@gmail.com>
  • Loading branch information
m-kuhn and 3nids committed May 6, 2020
1 parent 841328e commit 3e6c7c28f7ea04db5b3f0784e5b96250cb6e519d
@@ -83,7 +83,7 @@ def start_test_fold():
end_fold() # tag=build
start_test_fold()

if re.search('***Failed', updated_line) or re.search('***Timeout', updated_line):
if re.search(r'\*\*\*Failed', updated_line) or re.search(r'\*\*\*Timeout', updated_line):
end_fold()
updated_line = colored(updated_line, 'red')
in_failing_test = True
@@ -97,14 +97,14 @@ def start_test_fold():
in_failure = False
else:
updated_line = colored(updated_line, 'yellow')
elif re.search('*** Segmentation fault', updated_line):
elif re.search(r'\*\*\* Segmentation fault', updated_line):
start_fold('segfault')
updated_line = colored(updated_line, 'magenta')
elif re.match(' Test failed: Segmentation fault', updated_line):
end_fold()

else:
if re.match('(FAIL|ERROR)[:!].*', updated_line):
if re.match(r'(FAIL|ERROR)[:\!].*', updated_line):
updated_line = colored(updated_line, 'yellow')
in_failure = True

@@ -59,7 +59,7 @@ class FixSignals(fixer_base.BaseFix):

def transform(self, node, results):
signal = results.get("signal").value
signal = re.sub('^["\']([^(]+)(?:(.*))?["\']$', '\\1', signal)
signal = re.sub('^["\']([^(]+)(?:\\(.*\\))?["\']$', '\\1', signal)

if 'emitter' in results:
emitter = results.get("emitter").clone()
@@ -51,7 +51,7 @@


# Strip path and content length because path may vary
RE_STRIP_UNCHECKABLE = rb'MAP=[^"]+|Content-Length: \d+'
RE_STRIP_UNCHECKABLE = br'MAP=[^"]+|Content-Length: \d+'
RE_ELEMENT = br'</*([^>\[\s]+)[ >]'
RE_ELEMENT_CONTENT = br'<[^>\[]+>(.+)</[^>\[\s]+>'
RE_ATTRIBUTES = rb'((?:(?!\s|=).)*)\s*?=\s*?["\']?((?:(?<=")(?:(?<=\\)"|[^"])*|(?<=\')(?:(?<=\\)\'|[^\'])*)|(?:(?!"|\')(?:(?!\/>|>|\s).)+))'
@@ -92,7 +92,7 @@ def setUpClass(cls):
cls.server = subprocess.Popen([sys.executable, server_path],
env=os.environ, stdout=subprocess.PIPE)
line = cls.server.stdout.readline()
cls.port = int(re.findall(r':(\d+)', line)[0])
cls.port = int(re.findall(br':(\d+)', line)[0])
assert cls.port != 0
# Wait for the server process to start
assert waitServer('http://127.0.0.1:%s' % cls.port), "Server is not responding!"

0 comments on commit 3e6c7c2

Please sign in to comment.
You can’t perform that action at this time.