Deprecate the 'message' parameter of pytest.raises

Fix #3974
This commit is contained in:
Bruno Oliveira
2018-12-12 19:12:44 -02:00
parent 110fe2473f
commit 5b83417afc
7 changed files with 77 additions and 37 deletions

View File

@@ -121,8 +121,9 @@ class TestRaises(object):
def test_custom_raise_message(self):
message = "TEST_MESSAGE"
try:
with pytest.raises(ValueError, message=message):
pass
with pytest.warns(PytestDeprecationWarning):
with pytest.raises(ValueError, message=message):
pass
except pytest.raises.Exception as e:
assert e.msg == message
else: