def find_flaky_tests_main(args, base_path, top_level, stdout=None, stderr=None):
 stdout = (sys.stdout if (stdout is None) else stdout)
 stderr = (sys.stderr if (stderr is None) else stderr)
 options = FindFlakyTestsOptions(base_path.basename())
 try:
  options.parseOptions(args)
 except UsageError as e:
  stdout.write(str(options))
  stdout.write('\n')
  stderr.write('{}: {}\n'.format(base_path.basename(), e))
  sys.exit(1)
 flaky_tests = find_flaky_tests(options['suites'])
 _REPORTS[options['report']](stdout, flaky_tests)

def find_flaky_tests_main ( args , base_path , top_level , stdout = None , stderr = None ) : stdout = ( sys . stdout if ( stdout is None ) else stdout ) stderr = ( sys . stderr if ( stderr is None ) else stderr ) options = FindFlakyTestsOptions ( base_path . basename ( ) ) try : options . parseOptions ( args ) except UsageError as e : stdout . write ( str ( options ) ) stdout . write ( '\n' ) stderr . write ( '{}: {}\n' . format ( base_path . basename ( ) , e ) ) sys . exit ( 1 ) flaky_tests = find_flaky_tests ( options [ 'suites' ] ) _REPORTS [ options [ 'report' ] ] ( stdout , flaky_tests )
find and report on tests marked as flaky .