I am automating test cases in python and results are redirected to text file by default for unittest. I want result to be generated in XML format so that I can easily track passed and failed test cases. Please suggest.
1 Answer
There is a seperate package called unittest-xml-reporting
To use it add this to your unit test
import xmlrunner
Then pass the XMLRunner to unittest like this:
if __name__ == '__main__':
unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports'))