I would like to have a list of all the tests that have failed to be used at the end of session.
Pytest lets you define a hook pyt
I came access this question, trying to figure out internal data structure for the session
instance.
Iterating over session.items
you can check rep_call.outcome
for string representation of the test result.
def pytest_sessionfinish(session, exitstatus):
for item in session.items:
print('{} {}'.format(item.name, item.rep_call.outcome))
With trivial test cases you get this
test_positive passed
test_negative failed