@@ -124,15 +124,15 @@ def build_xml_doc(self, encoding=None):
124
124
125
125
# build the test suite element
126
126
test_suite_attributes = dict ()
127
- test_suite_attributes ["name" ] = decode (self .name , encoding )
128
127
if any (c .assertions for c in self .test_cases ):
129
128
test_suite_attributes ["assertions" ] = str (sum ([int (c .assertions ) for c in self .test_cases if c .assertions ]))
130
129
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 ()]))
132
130
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 )
133
133
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 ))
135
134
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 ))
136
136
137
137
if self .hostname :
138
138
test_suite_attributes ["hostname" ] = decode (self .hostname , encoding )
@@ -288,7 +288,7 @@ def to_xml_report_string(test_suites, prettyprint=True, encoding=None):
288
288
attributes = defaultdict (int )
289
289
for ts in test_suites :
290
290
ts_xml = ts .build_xml_doc (encoding = encoding )
291
- for key in ["failures " , "errors" , "tests " , "disabled " ]:
291
+ for key in ["disabled " , "errors" , "failures " , "tests " ]:
292
292
attributes [key ] += int (ts_xml .get (key , 0 ))
293
293
for key in ["time" ]:
294
294
attributes [key ] += float (ts_xml .get (key , 0 ))
0 commit comments