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:
Hodlinator
2025-09-20 19:59:08 +02:00
parent 5c16e4631c
commit a9021101dc

View File

@@ -559,10 +559,10 @@ class TestNode():
log = dl.read()
print_log = " - " + "\n - ".join(log.splitlines())
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))
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
if found:
return