def print_fails(stream):
 if (not FAILS):
  return
 stream.write('\n==============================\n')
 stream.write(('Failed %s tests - output below:' % len(FAILS)))
 stream.write('\n==============================\n')
 for f in FAILS:
  stream.write(('\n%s\n' % f['id']))
  stream.write(('%s\n' % ('-' * len(f['id']))))
  print_attachments(stream, f, all_channels=True)
 stream.write('\n')

def print_fails ( stream ) : if ( not FAILS ) : return stream . write ( '\n==============================\n' ) stream . write ( ( 'Failed %s tests - output below:' % len ( FAILS ) ) ) stream . write ( '\n==============================\n' ) for f in FAILS : stream . write ( ( '\n%s\n' % f [ 'id' ] ) ) stream . write ( ( '%s\n' % ( '-' * len ( f [ 'id' ] ) ) ) ) print_attachments ( stream , f , all_channels = True ) stream . write ( '\n' )
print summary failure report .