]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test_ukify: use raw string for the regex
authorFrantisek Sumsal <frantisek@sumsal.cz>
Sat, 3 Feb 2024 14:46:26 +0000 (15:46 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 3 Feb 2024 17:41:03 +0000 (02:41 +0900)
To get rid of the "invalid escape sequence" warning:

=============================== warnings summary ===============================
../src/ukify/test/test_ukify.py:876
  ../src/ukify/test/test_ukify.py:876: SyntaxWarning: invalid escape sequence '\s'
    assert re.search('Issuer: CN\s?=\s?SecureBoot signing key on host', out)

src/ukify/test/test_ukify.py

index 0a0a9024e96ece8b8ff1946e76be4f602edad745..f50e88d2f49708e15bab571afc90a4fe5b0e8372 100755 (executable)
@@ -859,7 +859,7 @@ def test_key_cert_generation(tmp_path):
         '-noout',
     ], text = True)
     assert 'Certificate' in out
-    assert re.search('Issuer: CN\s?=\s?SecureBoot signing key on host', out)
+    assert re.search(r'Issuer: CN\s?=\s?SecureBoot signing key on host', out)
 
 if __name__ == '__main__':
     sys.exit(pytest.main(sys.argv))