@@ -312,7 +312,7 @@ def _report_testsuite_properties(xml_testsuite, xml_document, properties):
312312
313313 _report_testsuite_properties = staticmethod (_report_testsuite_properties )
314314
315- def _report_testsuite (suite_name , tests , xml_document , parentElement ,
315+ def _report_testsuite (suite_name , suite , tests , xml_document , parentElement ,
316316 properties ):
317317 """
318318 Appends the testsuite section to the XML document.
@@ -335,6 +335,9 @@ def _report_testsuite(suite_name, tests, xml_document, parentElement,
335335 _XMLTestResult ._report_testsuite_properties (
336336 testsuite , xml_document , properties )
337337
338+ for test in tests :
339+ _XMLTestResult ._report_testcase (suite , test , testsuite , xml_document )
340+
338341 systemout = xml_document .createElement ('system-out' )
339342 testsuite .appendChild (systemout )
340343
@@ -447,10 +450,8 @@ def generate_reports(self, test_runner):
447450
448451 # Build the XML file
449452 testsuite = _XMLTestResult ._report_testsuite (
450- suite_name , tests , doc , parentElement , self .properties
453+ suite_name , suite , tests , doc , parentElement , self .properties
451454 )
452- for test in tests :
453- _XMLTestResult ._report_testcase (suite , test , testsuite , doc )
454455 xml_content = doc .toprettyxml (
455456 indent = '\t ' ,
456457 encoding = test_runner .encoding
0 commit comments