[Python-modules-commits] [pytest-mock] 04/06: Update tests to work with pytest 3

Vincent Bernat bernat at moszumanska.debian.org
Sat Oct 15 19:05:14 UTC 2016


This is an automated email from the git hooks/post-receive script.

bernat pushed a commit to branch master
in repository pytest-mock.

commit f13872e1a5118d1d13b2541988105376e9502527
Author: Vincent Bernat <vincent at bernat.im>
Date:   Sat Oct 15 20:55:53 2016 +0200

    Update tests to work with pytest 3
---
 test_pytest_mock.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test_pytest_mock.py b/test_pytest_mock.py
index 1d55295..f293a3c 100644
--- a/test_pytest_mock.py
+++ b/test_pytest_mock.py
@@ -176,7 +176,7 @@ class TestMockerStub:
         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")
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pytest-mock.git



More information about the Python-modules-commits mailing list