Skip to content

Commit a902110

Browse files
hodlinatorl0rinc
andcommitted
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 <[email protected]>
1 parent 5c16e46 commit a902110

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/functional/test_framework/test_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,10 +559,10 @@ def assert_debug_log(self, expected_msgs, unexpected_msgs=None, timeout=2):
559559
log = dl.read()
560560
print_log = " - " + "\n - ".join(log.splitlines())
561561
for unexpected_msg in unexpected_msgs:
562-
if re.search(re.escape(unexpected_msg), log, flags=re.MULTILINE):
562+
if unexpected_msg in log:
563563
self._raise_assertion_error('Unexpected message "{}" partially matches log:\n\n{}\n\n'.format(unexpected_msg, print_log))
564564
for expected_msg in expected_msgs:
565-
if re.search(re.escape(expected_msg), log, flags=re.MULTILINE) is None:
565+
if expected_msg not in log:
566566
found = False
567567
if found:
568568
return

0 commit comments

Comments
 (0)