From a9021101dc63ee7fb1e1f342387ab7d3f0e3cefc Mon Sep 17 00:00:00 2001 From: Hodlinator <172445034+hodlinator@users.noreply.github.com> Date: Sat, 20 Sep 2025 19:59:08 +0200 Subject: [PATCH] qa: Replace always-escaped regexps with "X in Y" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Always escaping the search string makes the use of regular expressions unnecessary. Co-authored-by: Lőrinc --- test/functional/test_framework/test_node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index 0540ca34694..3a13a923404 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -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