aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_uacomment.py
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2019-02-01 17:00:02 -0800
committerBen Woosley <ben.woosley@gmail.com>2019-09-03 14:38:38 -0400
commitb21680baf5391a602b295b9d7d0ef66553661cb9 (patch)
tree014dde0638aa584215f4855341606de65ed1fb89 /test/functional/feature_uacomment.py
parent6e431296daceee604f48e9e3e87fa84cfd44bef2 (diff)
downloadbitcoin-b21680baf5391a602b295b9d7d0ef66553661cb9.tar.xz
test/contrib: Fix invalid escapes in regex strings
Flagged by flake8 v3.6.0, as W605, plus a few others identified incidentally, e.g. 59ffecf66cf4d08c4b431e457b083878d66a3fd6. Note that r"\n" matches to "\n" under re.match/search.
Diffstat (limited to 'test/functional/feature_uacomment.py')
-rwxr-xr-xtest/functional/feature_uacomment.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/feature_uacomment.py b/test/functional/feature_uacomment.py
index fb4ad21359..85c250173f 100755
--- a/test/functional/feature_uacomment.py
+++ b/test/functional/feature_uacomment.py
@@ -27,12 +27,12 @@ class UacommentTest(BitcoinTestFramework):
self.log.info("test -uacomment max length")
self.stop_node(0)
- expected = "Error: Total length of network version string \([0-9]+\) exceeds maximum length \(256\). Reduce the number or size of uacomments."
+ expected = r"Error: Total length of network version string \([0-9]+\) exceeds maximum length \(256\). Reduce the number or size of uacomments."
self.nodes[0].assert_start_raises_init_error(["-uacomment=" + 'a' * 256], expected, match=ErrorMatch.FULL_REGEX)
self.log.info("test -uacomment unsafe characters")
for unsafe_char in ['/', ':', '(', ')', '₿', '🏃']:
- expected = "Error: User Agent comment \(" + re.escape(unsafe_char) + "\) contains unsafe characters."
+ expected = r"Error: User Agent comment \(" + re.escape(unsafe_char) + r"\) contains unsafe characters."
self.nodes[0].assert_start_raises_init_error(["-uacomment=" + unsafe_char], expected, match=ErrorMatch.FULL_REGEX)