summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandan Singh <csingh43@bloomberg.net>2018-12-14 19:16:01 +0000
committerChandan Singh <csingh43@bloomberg.net>2018-12-14 19:29:18 +0000
commitd960a33762c80f4d286b64fcf65a2f884fe66c1c (patch)
treef60a2e1bab76e1602a403b03c781dfd21843c168
parent13eb7ed2f356e1f42a8d379e313d55c5d3875d34 (diff)
downloadbuildstream-d960a33762c80f4d286b64fcf65a2f884fe66c1c.tar.gz
tests/frontend/logging.py: Fix regex Deprecation Warning
Use raw strings for regex searches, which is the preferred way to do regular expressions in Python. Without this patch, currently we get the following warnings: ``` tests/frontend/logging.py:44 /builds/BuildStream/buildstream/dist/buildstream/tests/frontend/logging.py:44: DeprecationWarning: invalid escape sequence \[ m = re.search("\[\d\d:\d\d:\d\d\]\[\]\[\] SUCCESS Checking sources", result.stderr) tests/frontend/logging.py:80 /builds/BuildStream/buildstream/dist/buildstream/tests/frontend/logging.py:80: DeprecationWarning: invalid escape sequence \d m = re.search("\d\d:\d\d:\d\d,\d\d:\d\d:\d\d.\d{6},\d\d:\d\d:\d\d,,,SUCCESS,Checking sources", result.stderr) ```
-rw-r--r--tests/frontend/logging.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/frontend/logging.py b/tests/frontend/logging.py
index 733c7e85d..1be21dddc 100644
--- a/tests/frontend/logging.py
+++ b/tests/frontend/logging.py
@@ -41,7 +41,7 @@ def test_default_logging(cli, tmpdir, datafiles):
result = cli.run(project=project, args=['fetch', element_name])
result.assert_success()
- m = re.search("\[\d\d:\d\d:\d\d\]\[\]\[\] SUCCESS Checking sources", result.stderr)
+ m = re.search(r"\[\d\d:\d\d:\d\d\]\[\]\[\] SUCCESS Checking sources", result.stderr)
assert(m is not None)
@@ -77,7 +77,7 @@ def test_custom_logging(cli, tmpdir, datafiles):
result = cli.run(project=project, args=['fetch', element_name])
result.assert_success()
- m = re.search("\d\d:\d\d:\d\d,\d\d:\d\d:\d\d.\d{6},\d\d:\d\d:\d\d,,,SUCCESS,Checking sources", result.stderr)
+ m = re.search(r"\d\d:\d\d:\d\d,\d\d:\d\d:\d\d.\d{6},\d\d:\d\d:\d\d,,,SUCCESS,Checking sources", result.stderr)
assert(m is not None)