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 <slev@altlinux.org>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
Stanislav Levin 2019-06-17 13:48:44 +03:00 committed by Fraser Tweedale
parent d16dd2fd62
commit 9836511a2b

View File

@ -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())