From 3801d0c1c8a3dbec54dead29666137de2649e109 Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Dec 02 2022 12:25:25 +0000 Subject: webui tests: fix assertion in test_subid.py The test wants to check the error related to an exception obtained inside a "with pytest.raises" instruction. The object is an ExceptionInfo and offers a match method to check the content of the string representation. Use this match() method instead of str(excinfo) which now returns '' Fixes: https://pagure.io/freeipa/issue/9282 Signed-off-by: Florence Blanc-Renaud Reviewed-By: Mohammad Rizwan Yusuf --- diff --git a/ipatests/test_webui/test_subid.py b/ipatests/test_webui/test_subid.py index 104b569..3aaf80a 100644 --- a/ipatests/test_webui/test_subid.py +++ b/ipatests/test_webui/test_subid.py @@ -146,5 +146,5 @@ class test_subid(UI_driver): with pytest.raises(NoSuchElementException) as excinfo: self.delete_record(admin_uid, table_name="ipauniqueid") # Ensure that the exception is really related to missing remove button - msg = "Unable to locate element: .facet-controls button[name=remove]" - assert msg in str(excinfo) + msg = r"Unable to locate element: .facet-controls button\[name=remove\]" + assert excinfo.match(msg)