pytest: How to get a list of all failed tests at the end of the session? (and while using xdist)

后端 未结 7 1892
一向
一向 2021-02-18 16:46

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

7条回答
  •  抹茶落季
    2021-02-18 17:26

    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
    

提交回复
热议问题