@@ -124,15 +124,15 @@ def build_xml_doc(self, encoding=None):
124124
125125 # build the test suite element
126126 test_suite_attributes = dict ()
127- test_suite_attributes ["name" ] = decode (self .name , encoding )
128127 if any (c .assertions for c in self .test_cases ):
129128 test_suite_attributes ["assertions" ] = str (sum ([int (c .assertions ) for c in self .test_cases if c .assertions ]))
130129 test_suite_attributes ["disabled" ] = str (len ([c for c in self .test_cases if not c .is_enabled ]))
131- test_suite_attributes ["failures" ] = str (len ([c for c in self .test_cases if c .is_failure ()]))
132130 test_suite_attributes ["errors" ] = str (len ([c for c in self .test_cases if c .is_error ()]))
131+ test_suite_attributes ["failures" ] = str (len ([c for c in self .test_cases if c .is_failure ()]))
132+ test_suite_attributes ["name" ] = decode (self .name , encoding )
133133 test_suite_attributes ["skipped" ] = str (len ([c for c in self .test_cases if c .is_skipped ()]))
134- test_suite_attributes ["time" ] = str (sum (c .elapsed_sec for c in self .test_cases if c .elapsed_sec ))
135134 test_suite_attributes ["tests" ] = str (len (self .test_cases ))
135+ test_suite_attributes ["time" ] = str (sum (c .elapsed_sec for c in self .test_cases if c .elapsed_sec ))
136136
137137 if self .hostname :
138138 test_suite_attributes ["hostname" ] = decode (self .hostname , encoding )
@@ -288,7 +288,7 @@ def to_xml_report_string(test_suites, prettyprint=True, encoding=None):
288288 attributes = defaultdict (int )
289289 for ts in test_suites :
290290 ts_xml = ts .build_xml_doc (encoding = encoding )
291- for key in ["failures " , "errors" , "tests " , "disabled " ]:
291+ for key in ["disabled " , "errors" , "failures " , "tests " ]:
292292 attributes [key ] += int (ts_xml .get (key , 0 ))
293293 for key in ["time" ]:
294294 attributes [key ] += float (ts_xml .get (key , 0 ))
0 commit comments