JUnit features an XML Test Runner that enables test output in XML format. This is very useful for buildbots and similar automated setups. PyUnit (the unittest module) lacks this capability. The attached file implements such an XML Test Runner and the matching unit tests. I did not try to generate a patch to the current SVN version and leave that to more capable hand. I think the current unittest module should probably changed into a unittest package like this: unittest/__init__.py - the current unittest.py file unittest/xmlrunner.py - the new XML runner Later __init__.py could be split into even more files like textrunner.py etc. I would like to hear about any improvements that the patch needs (even minor ones).
Logged In: YES user_id=1344176 I'd recommend that you release this somewhere like PyPI (http://cheeseshop.python.org/pypi) and see how well it does. If it flies off the shelf, then it could be considered for inclusion in the stdlib.
Logged In: YES user_id=47380 I attached an updated patch. It includes feedback by Mirko Friedenhagen: XmlTestRunner.run now returns the TestResult instead of a boolean, it is now possible to stream multiple test results into a single XML stream, since the XML declaration is left out, if no new file is created, and XmlTestRunner now gracefully recovers from tests overriding sys.stdout and sys.stderr.
As noted in an earlier comment, this needs to spend some time out in the Cheeseshop and build up a following before being included in the stdlib; closing.