@@ -37,8 +37,7 @@ def exporter_json(test_result_ext, test_suite_properties=None):
37
37
for target in test_result_ext .values ():
38
38
for suite in target .values ():
39
39
try :
40
- suite ["single_test_output" ] = suite ["single_test_output" ]\
41
- .decode ("utf-8" , "replace" )
40
+ suite ["single_test_output" ] = suite ["single_test_output" ]
42
41
except KeyError :
43
42
pass
44
43
return json .dumps (test_result_ext , indent = 4 )
@@ -161,16 +160,7 @@ def exporter_testcase_junit(test_result_ext, test_suite_properties=None):
161
160
test_results = test_result_ext [target_name ]
162
161
for test_suite_name in test_results :
163
162
test = test_results [test_suite_name ]
164
-
165
- try :
166
- if sys .version_info >= (3 , 0 ):
167
- tc_stdout = str (test ['single_test_output' ]).encode ('ascii' , 'ignore' )
168
- else :
169
- tc_stdout = test ['single_test_output' ].decode ('unicode_escape' ).encode ('ascii' , 'ignore' )
170
- except UnicodeDecodeError as e :
171
- err_mgs = "(UnicodeDecodeError) exporter_testcase_junit:" , str (e )
172
- tc_stdout = err_mgs
173
- print (err_mgs )
163
+ tc_stdout = test ['single_test_output' ]
174
164
175
165
# testcase_result stores info about test case results
176
166
testcase_result = test ['testcase_result' ]
@@ -189,18 +179,7 @@ def exporter_testcase_junit(test_result_ext, test_suite_properties=None):
189
179
utest_log = testcase_result [tc_name ].get ('utest_log' , '' )
190
180
result_text = testcase_result [tc_name ].get ('result_text' , "UNDEF" )
191
181
192
- try :
193
- lines = '\n ' .join (utest_log )
194
-
195
- if sys .version_info >= (3 , 0 ):
196
- tc_stderr = str (lines ).encode ('ascii' , 'ignore' )
197
- else :
198
- tc_stderr = lines .decode ('unicode_escape' ).encode ('ascii' , 'ignore' )
199
- except UnicodeDecodeError as e :
200
- err_mgs = "(UnicodeDecodeError) exporter_testcase_junit:" + str (e )
201
- tc_stderr = err_mgs
202
- print (err_mgs )
203
-
182
+ tc_stderr = '\n ' .join (utest_log )
204
183
tc_class = target_name + '.' + test_suite_name
205
184
206
185
if result_text == 'SKIPPED' :
@@ -604,12 +583,11 @@ def get_result_overlay_dropdowns(result_div_id, test_results):
604
583
605
584
# The HTML for the dropdown containing the ouput of the test
606
585
result_output_div_id = "%s_output" % result_div_id
607
- result_output_dropdown = get_dropdown_html (result_output_div_id ,
608
- "Test Output" ,
609
- test_results ['single_test_output' ]
610
- .decode ("utf-8" , "replace" )
611
- .rstrip ("\n " ),
612
- output_text = True )
586
+ result_output_dropdown = get_dropdown_html (
587
+ result_output_div_id , "Test Output" ,
588
+ test_results ['single_test_output' ].rstrip ("\n " ),
589
+ output_text = True
590
+ )
613
591
614
592
# Add a dropdown for the testcases if they are present
615
593
if len (test_results ) > 0 :
0 commit comments