python-pytest-mock/fix-for-pytest3.patch
Troy Dawson 00c1fd319c RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/python-pytest-mock#82bc63008efdbcb6dca4b68127f95e5766038f17
2020-10-14 20:00:26 -07:00

22 lines
969 B
Diff

diff --git a/test_pytest_mock.py b/test_pytest_mock.py
index 1e47d0e..e54649a 100644
--- a/test_pytest_mock.py
+++ b/test_pytest_mock.py
@@ -176,7 +176,7 @@ def __test_failure_message(self, mocker, **kwargs):
stub = mocker.stub(**kwargs)
with pytest.raises(AssertionError) as exc_info:
stub.assert_called_with()
- assert exc_info.value.msg == expected_message
+ assert str(exc_info.value) == expected_message
def test_failure_message_with_no_name(self, mocker):
self.__test_failure_message(mocker)
@@ -352,7 +352,7 @@ def assert_argument_introspection(left, right):
# test was run by examining sys.argv
verbose = any(a.startswith('-v') for a in sys.argv)
expected = '\n '.join(util._compare_eq_iterable(left, right, verbose))
- assert expected in e.msg
+ assert expected in str(e)
else:
raise AssertionError("DID NOT RAISE")