Publish unittest results from test discovery

Lucretiel lucretiel at gmail.com
Fri Aug 24 20:25:05 EDT 2012


So I've started using unittest, and I love it. I use testdiscovery (python -m unittest discover) so that I can distribute my tests and don't have to manage them all manually. I wanted to start publishing my test results to xml, though. I found xmlrunner by googling around, but it requires me to add an if __name__ == '__main__' block to my code, which isn't executed by unittest discover. Is there a way to get unittest disover to work with xmlrunner, or to some other way to solve this without restructuring all my test code?



More information about the Python-list mailing list