summaryrefslogtreecommitdiff
path: root/tests/unittests/test_util.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2018-04-18 03:35:41 -0600
committerChad Smith <chad.smith@canonical.com>2018-04-18 03:35:41 -0600
commitacca826adf39ddfedde78cfbfc47e81a06c6f42a (patch)
tree3f30b915acc60f31e12ed5467ba9b1e1fe990f42 /tests/unittests/test_util.py
parent6a979bb2fabd187efc392de7b0852cd0361bc9b8 (diff)
downloadvyos-cloud-init-acca826adf39ddfedde78cfbfc47e81a06c6f42a.tar.gz
vyos-cloud-init-acca826adf39ddfedde78cfbfc47e81a06c6f42a.zip
pycodestyle: Fix invalid escape sequences in string literals.
Python has deprecated these invalid string literals now https://bugs.python.org/issue27364 and pycodestyle is identifying them with a W605 warning. https://github.com/PyCQA/pycodestyle/pull/676 So basically, any use of \ not followed by one of [\'"abfnrtv] or \ooo (octal) \xhh (hex) or a newline is invalid. This is most comomnly seen for us in regex. To solve, you either: a.) use a raw string r'...' b.) correctly escape the \ that was not intended to be interpreted.
Diffstat (limited to 'tests/unittests/test_util.py')
-rw-r--r--tests/unittests/test_util.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py
index 50101906..7cbd5538 100644
--- a/tests/unittests/test_util.py
+++ b/tests/unittests/test_util.py
@@ -800,7 +800,7 @@ class TestSubp(helpers.CiTestCase):
os.chmod(noshebang, os.stat(noshebang).st_mode | stat.S_IEXEC)
self.assertRaisesRegex(util.ProcessExecutionError,
- 'Missing #! in script\?',
+ r'Missing #! in script\?',
util.subp, (noshebang,))
def test_returns_none_if_no_capture(self):