summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandan Singh <csingh43@bloomberg.net>2018-12-14 19:16:01 +0000
committerChandan Singh <chandan@chandansingh.net>2018-12-20 15:53:12 +0000
commitc05d8b4f08dd5d3c661db98d26b93f221d49e371 (patch)
tree48956476eb0c3b54ed360593fafa8ffa563985ae
parente0c575c453dbc379e04ff0694d15c836223e5850 (diff)
downloadbuildstream-c05d8b4f08dd5d3c661db98d26b93f221d49e371.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 be4b4213b..a10f62cc1 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=['source', '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=['source', '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)