def _run_suite(suite):
 if verbose:
  runner = unittest.TextTestRunner(sys.stdout, verbosity=2)
 else:
  runner = BasicTestRunner()
 result = runner.run(suite)
 if (not result.wasSuccessful()):
  if ((len(result.errors) == 1) and (not result.failures)):
   err = result.errors[0][1]
  elif ((len(result.failures) == 1) and (not result.errors)):
   err = result.failures[0][1]
  else:
   err = 'multiple errors occurred'
   if (not verbose):
    err += '; run in verbose mode for details'
  raise TestFailed(err)

def _run_suite ( suite ) : if verbose : runner = unittest . TextTestRunner ( sys . stdout , verbosity = 2 ) else : runner = BasicTestRunner ( ) result = runner . run ( suite ) if ( not result . wasSuccessful ( ) ) : if ( ( len ( result . errors ) == 1 ) and ( not result . failures ) ) : err = result . errors [ 0 ] [ 1 ] elif ( ( len ( result . failures ) == 1 ) and ( not result . errors ) ) : err = result . failures [ 0 ] [ 1 ] else : err = 'multiple errors occurred' if ( not verbose ) : err += '; run in verbose mode for details' raise TestFailed ( err )
run tests from a unittest .