kyrus / python-junit-xml

A Python module for creating JUnit XML test result documents that can be read by tools such as Jenkins. If you are ever working with test tool or test suite written in Python and want to take advantage of Jenkins' pretty graphs and test reporting capabilities, this module will let you generate the XML test reports.
MIT License
114 stars 66 forks source link

multiple test-suites #35

Open arpras opened 8 years ago

arpras commented 8 years ago

Thanks for the tool. Its pretty awesome.

Is there a way to create multiple testsuite with this package ?

Thanks

mgiaco commented 8 years ago

You wrote this a long time ago. But just for some others, this works already. See the test_junit_xml.py

drewsilcock commented 8 years ago

To clarify this and to save others the time to search through test_junit_xml.py, it is as simple as:

multi_suite_xml_string = TestSuite.to_xml_string([firstTestSuite, secondTestSuite])

Perhaps this could explicitly be mentioned in the README? I know it's obvious once you realise that TestSuite.to_xml_string takes an array of TestSuites, but naïvely it looks like it's not supported.