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
You can use command line option --result-log
:
test_dummy.py:
def test_dummy_success():
return
def test_dummy_fail():
raise Exception('Dummy fail')
Command line:
$ py.test --result-log=test_result.txt
Content of the test_result.txt
. test_dummy.py::test_dummy_success
F test_dummy.py::test_dummy_fail
def test_dummy_fail():
> raise Exception('Dummy fail')
E Exception: Dummy fail
test_dummy.py:6: Exception
Just search 'F' in first column and after that would be [file]::[test]