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
pyt
You can get the details of only failing tests and save the logs into a file with command below. Logs also contain the trace of each test.
py.test -rf tests/ | tee logs.txt