How to generate test report using pytest?

fhulprogrammer picture fhulprogrammer · Mar 18, 2015 · Viewed 27.6k times · Source

How can I generate test report using pytest? I searched for it but whatever i got was about coverage report. I tried with this command:

py.test sanity_tests.py --cov=C:\Test\pytest --cov-report=xml

But as parameters represents it generates coverage report not test report. Please help!!

Answer

Adam Smith picture Adam Smith · May 14, 2015

Ripped from the comments: you can use the --junitxml argument.

$ py.test sample_tests.py --junitxml=C:\path\to\out_report.xml