Exemplo n.º 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
Exemplo n.º 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) 
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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