mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 23:03:45 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user