From 9836511a2b6d7cf48b1a54cb3158e5eac674081a Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Mon, 17 Jun 2019 13:48:44 +0300 Subject: [PATCH] Fix Pytest4.x warning about `message` "message" parameter of pytest.raises is deprecated since Pytest4.1: ``` It is a common mistake to think this parameter will match the exception message, while in fact it only serves to provide a custom message in case the pytest.raises check fails. ``` That was the truth for test_unrecognised_attr_type_raises, which has wrongly checked an exception message. Fixes: https://pagure.io/freeipa/issue/7981 Signed-off-by: Stanislav Levin Reviewed-By: Christian Heimes --- ipatests/test_ipaclient/test_csrgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipatests/test_ipaclient/test_csrgen.py b/ipatests/test_ipaclient/test_csrgen.py index be8b440b0..625e1eba5 100644 --- a/ipatests/test_ipaclient/test_csrgen.py +++ b/ipatests/test_ipaclient/test_csrgen.py @@ -259,7 +259,7 @@ class test_CSRGenerator: with pytest.raises( errors.CSRTemplateError, - message='unrecognised attribute type: X'): + match=r'^unrecognised attribute type: X$'): csrgen_ffi.build_requestinfo( config.encode('utf-8'), adaptor.get_subject_public_key_info())