Skip to content

Fix pytest3 #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test_pytest_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")

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

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


Expand Down