You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can you get information about the status of the completed test in hooks pytest_runtest_call or pytest_runtest_teardown?
if i write
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_call(item):
outcome = yield
res = outcome.get_result()
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_teardown(item, nextitem):
outcome = yield
res = outcome.get_result()
in 'res' I don't see the test status, why? After all, logically, these hooks call the next tests or a teardown for a test and already know about the result of the completed test.
Why in hook 1 when filtering by call.when param at the 'teardown' stage do I see the status of my test as 'failed' although it passed? And at the 'call' stage - the test is marked as 'passed'
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello.
I use pytest 8.2.2
Could you please explain:
if i write
in 'res' I don't see the test status, why? After all, logically, these hooks call the next tests or a teardown for a test and already know about the result of the completed test.
return(yield)
?Beta Was this translation helpful? Give feedback.
All reactions