def _call_test_function(func, *args, **dargs):
 try:
  return func(*args, **dargs)
 except error.AutotestError:
  raise
 except Exception as e:
  raise error.UnhandledTestFail(e)

def _call_test_function ( func , * args , ** dargs ) : try : return func ( * args , ** dargs ) except error . AutotestError : raise except Exception as e : raise error . UnhandledTestFail ( e )
calls a test function and translates exceptions so that errors inside test code are considered test failures .