#NEWLINE# def generate_tap_reports( self ) : #NEWLINE# #INDENT# 'Generate TAP reports.\n\n        The results are either combined into a single output file or\n        the output file name is generated from the test case.\n        ' #NEWLINE# if tap_lines . streaming : #NEWLINE# #INDENT# print ( '1..{0}' . format ( self . combined_line_number ) , file = self . stream ) #NEWLINE# return #NEWLINE# #UNINDENT# if self . combined : #NEWLINE# #INDENT# combined_file = 'testresults.tap' #NEWLINE# if self . outdir : #NEWLINE# #INDENT# combined_file = os . path . join ( self . outdir , combined_file ) #NEWLINE# #UNINDENT# with open ( combined_file , 'w' ) as out_file : #NEWLINE# #INDENT# for test_case in self . combined_test_cases_seen : #NEWLINE# #INDENT# self . generate_tap_report ( test_case , self . _test_cases [ test_case ] , out_file ) #NEWLINE# #UNINDENT# print ( '1..{0}' . format ( self . combined_line_number ) , file = out_file ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for ( test_case , tap_lines ) in self . _test_cases . items ( ) : #NEWLINE# #INDENT# with open ( self . _get_tap_file_path ( test_case ) , 'w' ) as out_file : #NEWLINE# #INDENT# self . generate_tap_report ( test_case , tap_lines , out_file )