Skip to content
This repository has been archived by the owner on Feb 15, 2019. It is now read-only.

Commit

Permalink
bump requires to pytest 2.7
Browse files Browse the repository at this point in the history
change implementation to use @pytest.mark.hookwrapper instead of __multicall__ form of pytest_runtest_makereport
  • Loading branch information
okken committed Mar 27, 2015
1 parent ddcc142 commit 4e65168
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pytest_expect/plugin.py
Expand Up @@ -22,9 +22,10 @@ def _log_failure(node, msg=''):
node._failed_expect = []
node._failed_expect.append(entry)

@pytest.mark.tryfirst
def pytest_runtest_makereport(item, call, __multicall__):
report = __multicall__.execute()
@pytest.mark.hookwrapper
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
if (call.when == "call") and hasattr(item, '_failed_expect'):
summary = 'Failed Expectations:%s' % len(item._failed_expect)
item._failed_expect.append(summary)
Expand All @@ -33,5 +34,4 @@ def pytest_runtest_makereport(item, call, __multicall__):
else:
report.longrepr = '\n'.join(item._failed_expect)
report.outcome = "failed"
return report

3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -17,10 +17,9 @@
maintainer_email = 'brian@pythontesting.net',
url = 'https://github.com/okken/pytest-expect',
#url = 'http://pythontesting.net/pytest-expect',
#download_url = 'https://github.com/okken/pytest-expect/tarball/0.1',
license='MIT',
keywords = ['testing', 'pytest', 'assert'],
install_requires=['pytest>=2.5'],
install_requires=['pytest>=2.7'],
classifiers = [
'Intended Audience :: Developers',
'Topic :: Software Development :: Testing',
Expand Down

0 comments on commit 4e65168

Please sign in to comment.