chiark / gitweb /
Escape: Add missing r in regexp literals ('...' => r'...') [10]
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 14 Oct 2018 13:18:05 +0000 (14:18 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 14 Oct 2018 14:17:27 +0000 (15:17 +0100)
Detected by flake8, eg
 ./gbp/deb/git.py:35:6: W605 invalid escape sequence '\)'

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/18_test_Config.py
tests/23_test_dch_extract_bts_cmds.py

index 60cd9cffccadfd050a1720cefb15fbbd92d4fa2c..b2341588e2e001696496dc35352da406dd701126 100644 (file)
@@ -50,7 +50,7 @@ class TestConfigParser(unittest.TestCase, GbpLogTester):
             parser = GbpOptionParser('%scmd2' % prefix)
             self.assertEqual(parser.config['single_git_override_option1'], 'single_git_override_value1')
         for line in range(0, 2):
-            self._check_log(line, ".*Old style config section \[git-cmd2\] found please rename to \[cmd2\]")
+            self._check_log(line, r".*Old style config section \[git-cmd2\] found please rename to \[cmd2\]")
 
     def test_single_gbp_override(self):
         """
@@ -60,7 +60,7 @@ class TestConfigParser(unittest.TestCase, GbpLogTester):
             parser = GbpOptionParser('%scmd3' % prefix)
             self.assertEqual(parser.config['single_gbp_override_option1'], 'single_gbp_override_value1')
         for line in range(0, 2):
-            self._check_log(line, ".*Old style config section \[gbp-cmd3\] found please rename to \[cmd3\]")
+            self._check_log(line, r".*Old style config section \[gbp-cmd3\] found please rename to \[cmd3\]")
 
     def test_single_git_override_disabled_deprecations(self):
         """
index e1fb7e0ad6cafa2301a2874a9911752c8974624a..42d4bac351aae1e5792a1a59d72cc4e3b16d8681 100644 (file)
@@ -41,7 +41,7 @@ Closes: 456
         """Test non-default BTS commands. We use the example given in the
         documentation manpages."""
         options = OptionsStub()
-        options.meta_closes_bugnum = "(?:bug)?\s*ex-\d+"
+        options.meta_closes_bugnum = r"(?:bug)?\s*ex-\d+"
         lines = """This is a test commit
 some more lines...