diff options
author | Stephen Finucane <stephenfin@redhat.com> | 2021-04-20 17:16:55 +0100 |
---|---|---|
committer | Stephen Finucane <stephenfin@redhat.com> | 2021-04-20 17:16:55 +0100 |
commit | fbd95162279a1aca3f4f2251edd09d6bac16f43d (patch) | |
tree | 600afd933b0cbffe7da969bd4ccd895f70bcb0f4 /python/subunit/__init__.py | |
parent | 1dafb884e47f5fc26232672b01c2a9574577e7be (diff) | |
download | subunit-git-fbd95162279a1aca3f4f2251edd09d6bac16f43d.tar.gz |
python: Mark rawstrings as such
Resolves the following warnings in Python 3.6+:
DeprecationWarning: invalid escape sequence \!
match = re.match("Bail out\!(?:\s*(.*))?\n", line)
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Diffstat (limited to 'python/subunit/__init__.py')
-rw-r--r-- | python/subunit/__init__.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index 17a970a..becbdac 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -1033,7 +1033,7 @@ def TAP2SubUnit(tap, output_stream): file_name=file_name, runnable=False) for line in tap: if state == BEFORE_PLAN: - match = re.match("(\d+)\.\.(\d+)\s*(?:\#\s+(.*))?\n", line) + match = re.match(r"(\d+)\.\.(\d+)\s*(?:\#\s+(.*))?\n", line) if match: state = AFTER_PLAN _, plan_stop, comment = match.groups() @@ -1046,7 +1046,7 @@ def TAP2SubUnit(tap, output_stream): file_name='tap comment') continue # not a plan line, or have seen one before - match = re.match("(ok|not ok)(?:\s+(\d+)?)?(?:\s+([^#]*[^#\s]+)\s*)?(?:\s+#\s+(TODO|SKIP|skip|todo)(?:\s+(.*))?)?\n", line) + match = re.match(r"(ok|not ok)(?:\s+(\d+)?)?(?:\s+([^#]*[^#\s]+)\s*)?(?:\s+#\s+(TODO|SKIP|skip|todo)(?:\s+(.*))?)?\n", line) if match: # new test, emit current one. _emit_test() @@ -1074,7 +1074,7 @@ def TAP2SubUnit(tap, output_stream): test_name = "test %d%s" % (plan_start, description) plan_start += 1 continue - match = re.match("Bail out\!(?:\s*(.*))?\n", line) + match = re.match(r"Bail out\!(?:\s*(.*))?\n", line) if match: reason, = match.groups() if reason is None: @@ -1086,7 +1086,7 @@ def TAP2SubUnit(tap, output_stream): result = "fail" state = SKIP_STREAM continue - match = re.match("\#.*\n", line) + match = re.match(r"\#.*\n", line) if match: log.append(line[:-1]) continue |