Remove 'message' parameter from pytest.raises

This commit is contained in:
Bruno Oliveira
2019-06-30 11:48:27 -03:00
parent 279733a30b
commit 13f7f27fd2
6 changed files with 42 additions and 68 deletions

View File

@@ -2,7 +2,6 @@ import sys
import pytest
from _pytest.outcomes import Failed
from _pytest.warning_types import PytestDeprecationWarning
class TestRaises:
@@ -155,17 +154,6 @@ class TestRaises:
else:
assert False, "Expected pytest.raises.Exception"
def test_custom_raise_message(self):
message = "TEST_MESSAGE"
try:
with pytest.warns(PytestDeprecationWarning):
with pytest.raises(ValueError, message=message):
pass
except pytest.raises.Exception as e:
assert e.msg == message
else:
assert False, "Expected pytest.raises.Exception"
@pytest.mark.parametrize("method", ["function", "with"])
def test_raises_cyclic_reference(self, method):
"""