Skip to content

Commit 5416c11

Browse files
authored
Merge pull request #63 from pytest-dev/fix-pytest3
Fix pytest3
2 parents fb401b1 + 86aa0d2 commit 5416c11

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

test_pytest_mock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def __test_failure_message(self, mocker, **kwargs):
176176
stub = mocker.stub(**kwargs)
177177
with pytest.raises(AssertionError) as exc_info:
178178
stub.assert_called_with()
179-
assert exc_info.value.msg == expected_message
179+
assert str(exc_info.value) == expected_message
180180

181181
def test_failure_message_with_no_name(self, mocker):
182182
self.__test_failure_message(mocker)
@@ -352,7 +352,7 @@ def assert_argument_introspection(left, right):
352352
# test was run by examining sys.argv
353353
verbose = any(a.startswith('-v') for a in sys.argv)
354354
expected = '\n '.join(util._compare_eq_iterable(left, right, verbose))
355-
assert expected in e.msg
355+
assert expected in str(e)
356356
else:
357357
raise AssertionError("DID NOT RAISE")
358358

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
[tox]
22
# note that tox expects interpreters to be found at C:\PythonXY,
33
# with XY being python version ("27" or "34") for instance
4-
envlist = py{26,27,33,34,35}-pytest{27,28},linting
4+
envlist = py{26,27,33,34,35}-pytest{27,28,30},linting
55

66
[testenv]
77
passenv = USER USERNAME
88
deps =
99
coverage
1010
pytest27: pytest==2.7.3
1111
pytest28: pytest==2.8.7
12+
# temporary until pytest-dev/pytest#1935 is merged
13+
pytest30: git+https://github.com/nicoddemus/pytest@assert-rewrite-dev-plugins
1214
commands = coverage run --append --source=pytest_mock.py -m pytest test_pytest_mock.py
1315

1416

0 commit comments

Comments
 (0)