From d0e8472ab5747163a769a253c6e8acca818d734f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 15 May 2019 15:47:44 +0200 Subject: [PATCH] Remove invalid escape sequences MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This emits a warning on Python 3.8. Let's just fix it. Signed-off-by: Lubomír Sedlář --- pungi/phases/pkgset/sources/source_koji.py | 2 +- tests/test_extra_files_phase.py | 4 +++- tests/test_pkgset_source_koji.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pungi/phases/pkgset/sources/source_koji.py b/pungi/phases/pkgset/sources/source_koji.py index a96c9730..c406b5a5 100644 --- a/pungi/phases/pkgset/sources/source_koji.py +++ b/pungi/phases/pkgset/sources/source_koji.py @@ -86,7 +86,7 @@ def variant_dict_from_str(compose, module_str): module_info = {} # The regex is matching a string which should represent the release number # of a module. The release number is in format: "%Y%m%d%H%M%S" - release_regex = re.compile("^(\d){14}$") + release_regex = re.compile(r"^(\d){14}$") section_start = module_str.rfind('-') module_str_first_part = module_str[section_start+1:] diff --git a/tests/test_extra_files_phase.py b/tests/test_extra_files_phase.py index 54daedb3..40925763 100644 --- a/tests/test_extra_files_phase.py +++ b/tests/test_extra_files_phase.py @@ -159,7 +159,9 @@ class TestCopyFiles(helpers.PungiTestCase): extra_files.copy_extra_files( compose, [cfg], 'x86_64', compose.variants['Server'], package_sets) - self.assertRegexpMatches(str(ctx.exception), 'No.*package.*matching bad-server\*.*') + self.assertRegexpMatches( + str(ctx.exception), r'No.*package.*matching bad-server\*.*' + ) self.assertEqual(len(get_file_from_scm.call_args_list), 0) self.assertEqual(get_dir_from_scm.call_args_list, []) diff --git a/tests/test_pkgset_source_koji.py b/tests/test_pkgset_source_koji.py index 5c0a6509..f86a8dcc 100644 --- a/tests/test_pkgset_source_koji.py +++ b/tests/test_pkgset_source_koji.py @@ -465,7 +465,7 @@ class TestCorrectNVR(helpers.PungiTestCase): self.compose = helpers.DummyCompose(self.topdir, {}) self.nv = "base-runtime-f26" self.nvr = "base-runtime-f26-20170502134116" - self.release_regex = re.compile("^(\d){14}$") + self.release_regex = re.compile(r"^(\d){14}$") self.new_nv = "base-runtime:f26" self.new_nvr = "base-runtime:f26:20170502134116" self.new_nvrc = "base-runtime:f26:20170502134116:0123abcd"