diff mbox series

[4/4] oeqa: selftest: Use raw strings where required for regexes

Message ID 20261030-selftest-fixes-v1-4-1ba0fc952001@pbarker.dev
State New
Headers show
Series Selftest fixes | expand

Commit Message

Paul Barker Oct. 30, 2026, 6:22 p.m. UTC
We need to use raw string literals to avoid misinterpretation of escape
sequences.

Signed-off-by: Paul Barker <paul@pbarker.dev>
---
 meta/lib/oeqa/selftest/cases/bblock.py       | 4 ++--
 meta/lib/oeqa/selftest/cases/buildhistory.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/bblock.py b/meta/lib/oeqa/selftest/cases/bblock.py
index cb99d32bb5d0..6ed1172f2e9b 100644
--- a/meta/lib/oeqa/selftest/cases/bblock.py
+++ b/meta/lib/oeqa/selftest/cases/bblock.py
@@ -35,7 +35,7 @@  class BBLock(OESelftestTestCase):
             for recipe in recipes:
                 for task in tasks:
                     find_in_contents = re.search(
-                        'SIGGEN_LOCKEDSIGS_.+\s\+=\s"%s:%s:.*"' % (recipe, task),
+                        r'SIGGEN_LOCKEDSIGS_.+\s\+=\s"%s:%s:.*"' % (recipe, task),
                         contents,
                     )
                     self.assertFalse(
@@ -62,7 +62,7 @@  class BBLock(OESelftestTestCase):
             if tasks:
                 for task in tasks:
                     find_in_contents = re.search(
-                        'SIGGEN_LOCKEDSIGS_.+\s\+=\s"%s:%s:.*"' % (recipe, task),
+                        r'SIGGEN_LOCKEDSIGS_.+\s\+=\s"%s:%s:.*"' % (recipe, task),
                         contents,
                     )
                     self.assertTrue(
diff --git a/meta/lib/oeqa/selftest/cases/buildhistory.py b/meta/lib/oeqa/selftest/cases/buildhistory.py
index 1edc60c72d0e..43bcc1bd3648 100644
--- a/meta/lib/oeqa/selftest/cases/buildhistory.py
+++ b/meta/lib/oeqa/selftest/cases/buildhistory.py
@@ -55,7 +55,7 @@  class BuildhistoryTests(OESelftestTestCase):
 
     def test_buildhistory_buildtime_pr_backwards(self):
         target = 'xcursor-transparent-theme'
-        error = "ERROR:.*QA Issue: Package version for package %s went backwards which would break package feeds \(from .*-r1.* to .*-r0.*\)" % target
+        error = r"ERROR:.*QA Issue: Package version for package %s went backwards which would break package feeds \(from .*-r1.* to .*-r0.*\)" % target
         self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True)
         self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True, error_regex=error)