Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

fix(python): fix invalid escape sequences

Commit
ceed26842b3b3f93523998f7adb672672c7c2d8f
Author
Eisuke Kawashima ·
Committer
Chris Thrasher
Parents
04cbcfa1d1da

Files · Download .tar.gz

Changes

 tests/TestScripts/DiscoverTests/VerifyRegistration.py | 2 +-
 tools/scripts/approvalTests.py                        | 6 +++---
 tools/scripts/checkConvenienceHeaders.py              | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/TestScripts/DiscoverTests/VerifyRegistration.py b/tests/TestScripts/DiscoverTests/VerifyRegistration.py
index 33150cae..7d9862cf 100644
--- a/tests/TestScripts/DiscoverTests/VerifyRegistration.py
+++ b/tests/TestScripts/DiscoverTests/VerifyRegistration.py
@@ -17,7 +17,7 @@ from typing import List
 
 TestInfo = namedtuple('TestInfo', ['name', 'tags'])
 
-cmake_version_regex = re.compile('cmake version (\d+)\.(\d+)\.(\d+)')
+cmake_version_regex = re.compile(r'cmake version (\d+)\.(\d+)\.(\d+)')
 
 def get_cmake_version():
     result = subprocess.run(['cmake', '--version'],
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'