Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tools/scripts
diff options
context:
space:
mode:
authorEisuke Kawashima2025-06-09 10:10:19 +0900
committerChris Thrasher2025-06-24 15:32:27 -0600
commitceed26842b3b3f93523998f7adb672672c7c2d8f (patch)
tree7acdb40c92be4b74c031867b32b27d83df2452d4 /tools/scripts
parent04cbcfa1d1da6675311859bf081df961103ae7c2 (diff)
downloadcatch3-ceed26842b3b3f93523998f7adb672672c7c2d8f.tar.gz
fix(python): fix invalid escape sequences
Diffstat (limited to 'tools/scripts')
-rwxr-xr-xtools/scripts/approvalTests.py6
-rwxr-xr-xtools/scripts/checkConvenienceHeaders.py4
2 files changed, 5 insertions, 5 deletions
diff --git a/tools/scripts/approvalTests.py b/tools/scripts/approvalTests.py
index 4146b646..144edc06 100755
--- a/tools/scripts/approvalTests.py
+++ b/tools/scripts/approvalTests.py
@@ -121,7 +121,7 @@ def filterLine(line, isCompact):
# strip source line numbers
# Note that this parser assumes an already normalized filepath from above,
# and might break terribly if it is moved around before the normalization.
- line = filelocParser.sub('\g<filename>:<line number>', line)
+ line = filelocParser.sub(r'\g<filename>:<line number>', line)
line = lineNumberParser.sub(" ", line)
@@ -130,7 +130,7 @@ def filterLine(line, isCompact):
line = line.replace(': PASSED', ': passed')
# strip out the test order number in TAP to avoid massive diffs for every change
- line = tapTestNumParser.sub("\g<1> {test-number} -", line)
+ line = tapTestNumParser.sub(r"\g<1> {test-number} -", line)
# strip Catch2 version number
line = versionParser.sub("<version>", line)
@@ -148,7 +148,7 @@ def filterLine(line, isCompact):
line = junitDurationsParser.sub(' time="{duration}"', line)
line = durationParser.sub(' duration="{duration}"', line)
line = timestampsParser.sub('{iso8601-timestamp}', line)
- line = specialCaseParser.sub('file:\g<1>', line)
+ line = specialCaseParser.sub(r'file:\g<1>', line)
line = sinceEpochParser.sub('{since-epoch-report}', line)
return line
diff --git a/tools/scripts/checkConvenienceHeaders.py b/tools/scripts/checkConvenienceHeaders.py
index 41b52ced..06957524 100755
--- a/tools/scripts/checkConvenienceHeaders.py
+++ b/tools/scripts/checkConvenienceHeaders.py
@@ -21,11 +21,11 @@ import os
import re
def normalized_path(path):
- """Replaces \ in paths on Windows with /"""
+ r"""Replaces \ in paths on Windows with /"""
return path.replace('\\', '/')
def normalized_paths(paths):
- """Replaces \ with / in every path"""
+ r"""Replaces \ with / in every path"""
return [normalized_path(path) for path in paths]
source_path = catchPath + '/src/catch2'