#NEWLINE# def write_report( name , project , logger , result , console_out ) : #NEWLINE# #INDENT# project . write_report ( ( '%s' % name ) , console_out ) #NEWLINE# report = { #NEWLINE# #INDENT# 'tests-run' : result . testsRun , #NEWLINE# 'errors' : [ ] , #NEWLINE# 'failures' : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# for error in result . errors : #NEWLINE# #INDENT# report [ 'errors' ] . append ( { #NEWLINE# #INDENT# 'test' : error [ 0 ] . id ( ) , #NEWLINE# 'traceback' : error [ 1 ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# logger . error ( 'Test has error: %s' , error [ 0 ] . id ( ) ) #NEWLINE# if project . get_property ( 'verbose' ) : #NEWLINE# #INDENT# print_text_line ( error [ 1 ] ) #NEWLINE# #UNINDENT# #UNINDENT# for failure in result . failures : #NEWLINE# #INDENT# report [ 'failures' ] . append ( { #NEWLINE# #INDENT# 'test' : failure [ 0 ] . id ( ) , #NEWLINE# 'traceback' : failure [ 1 ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# logger . error ( 'Test failed: %s' , failure [ 0 ] . id ( ) ) #NEWLINE# if project . get_property ( 'verbose' ) : #NEWLINE# #INDENT# print_text_line ( failure [ 1 ] ) #NEWLINE# #UNINDENT# #UNINDENT# project . write_report ( ( '%s.json' % name ) , render_report ( report ) ) #NEWLINE# report_to_ci_server ( project , result )