Skip to content
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

Make _hook_into_pytest() work with pytest-4.1 #28

Merged
merged 1 commit into from Jan 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions flexmock.py
Expand Up @@ -1224,8 +1224,11 @@ def call_runtest_hook(item, when, **kwargs):
ret = saved(item, when, **kwargs)
if when != 'call' and ret.excinfo is None:
return ret
teardown = runner.CallInfo(flexmock_teardown, when=when)
teardown.result = None
if hasattr(runner.CallInfo, "from_call"):
teardown = runner.CallInfo.from_call(flexmock_teardown, when=when)
else:
teardown = runner.CallInfo(flexmock_teardown, when=when)
teardown.result = None
if ret.excinfo is not None and teardown.excinfo is None:
teardown.excinfo = ret.excinfo
return teardown
Expand Down