Exemple #1
0
 def execute_appex(self, space, target, *args):
     try:
         target(*args)
     except OperationError, e:
         if e.match(space, space.w_KeyboardInterrupt):
             tb = sys.exc_info()[2]
             raise OpErrKeyboardInterrupt, OpErrKeyboardInterrupt(), tb
         appexcinfo = appsupport.AppExceptionInfo(space, e)
         if appexcinfo.traceback:
             raise Failed(excinfo=appsupport.AppExceptionInfo(space, e))
         raise
Exemple #2
0
def callex(space, func, *args, **kwargs): 
    try: 
        return func(*args, **kwargs) 
    except OperationError, e: 
        ilevelinfo = py.code.ExceptionInfo()
        if e.match(space, space.w_KeyboardInterrupt): 
            raise KeyboardInterrupt 
        appexcinfo = appsupport.AppExceptionInfo(space, e) 
        if appexcinfo.traceback: 
            print "appexcinfo.traceback:"
            py.std.pprint.pprint(appexcinfo.traceback)
            raise py.test.collect.Item.Failed(excinfo=appexcinfo) 
        raise py.test.collect.Item.Failed(excinfo=ilevelinfo) 
Exemple #3
0
 def execute_appex(self, space, target, *args):
     try:
         target(*args)
     except OperationError, e:
         if self.config.option.verbose:
             raise
         tb = sys.exc_info()[2]
         if e.match(space, space.w_KeyboardInterrupt):
             raise KeyboardInterrupt, KeyboardInterrupt(), tb
         appexcinfo = appsupport.AppExceptionInfo(space, e)
         if appexcinfo.traceback:
             raise AppError, AppError(appexcinfo), tb
         raise
Exemple #4
0
 def execute_appex(self, space, target, *args):
     self.space = space
     space.getexecutioncontext().set_sys_exc_info(None)
     try:
         target(*args)
     except OperationError as e:
         if self.config.option.raise_operr:
             raise
         tb = sys.exc_info()[2]
         if e.match(space, space.w_KeyboardInterrupt):
             raise KeyboardInterrupt, KeyboardInterrupt(), tb
         appexcinfo = appsupport.AppExceptionInfo(space, e)
         if appexcinfo.traceback:
             raise AppError, AppError(appexcinfo), tb
         raise
Exemple #5
0
 def execute_appex(self, space, w_func):
     space.getexecutioncontext().set_sys_exc_info(None)
     sig = w_func.code._signature
     if sig.varargname or sig.kwargname:
         raise ValueError('Test functions may not use *args or **kwargs')
     args_w = self.get_fixtures(space, sig.argnames)
     try:
         space.call_function(w_func, *args_w)
     except OperationError as e:
         if self.config.option.raise_operr:
             raise
         tb = sys.exc_info()[2]
         if e.match(space, space.w_KeyboardInterrupt):
             raise KeyboardInterrupt, KeyboardInterrupt(), tb
         appexcinfo = appsupport.AppExceptionInfo(space, e)
         if appexcinfo.traceback:
             raise AppError, AppError(appexcinfo), tb
         raise