def runTestFast(test_name):
 old_stderr = sys.stderr
 old_stdout = sys.stdout
 f = open('temp.log', 'w')
 ec = 0
 errors = ''
 try:
  sys.stdout = f
  sys.stderr = f
  __import__(test_name.split('.py')[0])
 except SystemExit:
  ec = int(str(sys.exc_value))
 except:
  ec = 1
 finally:
  sys.stderr = old_stderr
  sys.stdout = old_stdout
  f.close()
 if (ec != 0):
  f = open('temp.log', 'r')
  for line in f.readlines():
   errors = (errors + line)
  f.close()
 return (ec, errors)

def runTestFast ( test_name ) : old_stderr = sys . stderr old_stdout = sys . stdout f = open ( 'temp.log' , 'w' ) ec = 0 errors = '' try : sys . stdout = f sys . stderr = f __import__ ( test_name . split ( '.py' ) [ 0 ] ) except SystemExit : ec = int ( str ( sys . exc_value ) ) except : ec = 1 finally : sys . stderr = old_stderr sys . stdout = old_stdout f . close ( ) if ( ec != 0 ) : f = open ( 'temp.log' , 'r' ) for line in f . readlines ( ) : errors = ( errors + line ) f . close ( ) return ( ec , errors )
helper function simply imports a test as a module .