qa: Replace always-escaped regexps with "X in Y"
Always escaping the search string makes the use of regular expressions unnecessary. Co-authored-by: Lőrinc <pap.lorinc@gmail.com>
This commit is contained in:
1 file changed
+2
-2
@@ -559,10 +559,10 @@ class TestNode():
|
|||||||
log = dl.read()
|
log = dl.read()
|
||||||
print_log = " - " + "\n - ".join(log.splitlines())
|
print_log = " - " + "\n - ".join(log.splitlines())
|
||||||
for unexpected_msg in unexpected_msgs:
|
for unexpected_msg in unexpected_msgs:
|
||||||
if re.search(re.escape(unexpected_msg), log, flags=re.MULTILINE):
|
if unexpected_msg in log:
|
||||||
self._raise_assertion_error('Unexpected message "{}" partially matches log:\n\n{}\n\n'.format(unexpected_msg, print_log))
|
self._raise_assertion_error('Unexpected message "{}" partially matches log:\n\n{}\n\n'.format(unexpected_msg, print_log))
|
||||||
for expected_msg in expected_msgs:
|
for expected_msg in expected_msgs:
|
||||||
if re.search(re.escape(expected_msg), log, flags=re.MULTILINE) is None:
|
if expected_msg not in log:
|
||||||
found = False
|
found = False
|
||||||
if found:
|
if found:
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in new issue
Block a user