-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
type: bugproblem that needs to be addressedproblem that needs to be addressed
Description
I have a warning that _multicall is deprecated, so I have to change the code I have
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_makereport(___multicall__):
# Execute all other hooks to obtain the report object.
rep = ___multicall__.execute()
if rep.failed:
# my logic to figure out I want to xfail
if 'decided I want to xfail':
TestApi.add_analysis('socket hang up')
setattr(rep, "outcome", "skipped")
setattr(rep, "wasxfail", 'socket hang up')
return rep
return repto this code:
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport():
# Execute all other hooks to obtain the report object.
outcome = yield
rep = outcome.get_result()
if rep.failed:
# my logic to figure out I want to xfail
if 'decided I want to xfail':
TestApi.add_analysis('socket hang up')
setattr(rep, "outcome", "skipped")
setattr(rep, "wasxfail", 'socket hang up')
return rep
return repproblem python < 3.3 doesn't support returning from a generator, so how am I supposued to return a modified result ?
changing the object in-place would be enough ?
Metadata
Metadata
Assignees
Labels
type: bugproblem that needs to be addressedproblem that needs to be addressed