@@ -104,22 +104,17 @@ def _write_testsuite(self, file, suite, tests):
104
104
failures = sum (1 for t in tests if t .isFailure ())
105
105
106
106
name = suite .config .name .replace ('.' , '-' )
107
- # file.write(f'<testsuite name={quo(name)} tests="{len(tests)}" failures="{failures}" skipped="{skipped}">\n')
108
- file .write ('<testsuite name={name} tests="{tests}" failures="{failures}" skipped="{skipped}">\n ' .format (
109
- name = quo (name ), tests = len (tests ), failures = failures , skipped = skipped ))
107
+ file .write (f'<testsuite name={ quo (name )} tests="{ len (tests )} " failures="{ failures } " skipped="{ skipped } ">\n ' )
110
108
for test in tests :
111
109
self ._write_test (file , test , name )
112
110
file .write ('</testsuite>\n ' )
113
111
114
112
def _write_test (self , file , test , suite_name ):
115
113
path = '/' .join (test .path_in_suite [:- 1 ]).replace ('.' , '_' )
116
- # class_name = f'{suite_name}.{path or suite_name}'
117
- class_name = suite_name + '.' + (path or suite_name )
114
+ class_name = f'{ suite_name } .{ path or suite_name } '
118
115
name = test .path_in_suite [- 1 ]
119
116
time = test .result .elapsed or 0.0
120
- # file.write(f'<testcase classname={quo(class_name)} name={quo(name)} time="{time:.2f}"')
121
- file .write ('<testcase classname={class_name} name={name} time="{time:.2f}"' .format (
122
- class_name = quo (class_name ), name = quo (name ), time = time ))
117
+ file .write (f'<testcase classname={ quo (class_name )} name={ quo (name )} time="{ time :.2f} "' )
123
118
124
119
if test .isFailure ():
125
120
file .write ('>\n <failure><![CDATA[' )
@@ -140,9 +135,7 @@ def _write_test(self, file, test, suite_name):
140
135
file .write (']]></failure>\n </testcase>\n ' )
141
136
elif test .result .code in self .skipped_codes :
142
137
reason = self ._get_skip_reason (test )
143
- # file.write(f'>\n <skipped message={quo(reason)}/>\n</testcase>\n')
144
- file .write ('>\n <skipped message={reason}/>\n </testcase>\n ' .format (
145
- reason = quo (reason )))
138
+ file .write (f'>\n <skipped message={ quo (reason )} />\n </testcase>\n ' )
146
139
else :
147
140
file .write ('/>\n ' )
148
141
0 commit comments