#NEWLINE# def write_json_log( jsonlogfile , test_name , result ) : #NEWLINE# #INDENT# jresult = { #NEWLINE# #INDENT# 'name' : test_name , #NEWLINE# 'stdout' : result . stdo , #NEWLINE# 'result' : result . res , #NEWLINE# 'duration' : result . duration , #NEWLINE# 'returncode' : result . returncode , #NEWLINE# 'command' : result . cmd , #NEWLINE# #UNINDENT# } #NEWLINE# if result . stde : #NEWLINE# #INDENT# jresult [ 'stderr' ] = result . stde #NEWLINE# #UNINDENT# jsonlogfile . write ( ( json . dumps ( jresult ) + '\n' ) )