From 1e6016ccc2e3b89ce3613784db407ada159ae42d Mon Sep 17 00:00:00 2001 From: fijal Date: Wed, 7 Feb 2007 21:04:01 +0100 Subject: [PATCH] [svn r38113] Make fatal() attribute which makes boxed tests catch SystemExit, while in-process let it slide. --HG-- branch : trunk --- py/test/rsession/executor.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/py/test/rsession/executor.py b/py/test/rsession/executor.py index 17be5cffd..38fec1bd4 100644 --- a/py/test/rsession/executor.py +++ b/py/test/rsession/executor.py @@ -22,6 +22,9 @@ class RunExecutor(object): def run(self): self.item.run() + + def fatals(self): + return (SystemExit, KeyboardInterrupt) def execute(self): try: @@ -29,6 +32,8 @@ class RunExecutor(object): outcome = Outcome() except Skipped, e: outcome = Outcome(skipped=str(e)) + except self.fatals(): + raise except: excinfo = py.code.ExceptionInfo() if isinstance(self.item, py.test.Function): @@ -78,7 +83,10 @@ class BoxExecutor(RunExecutor): """ Same as RunExecutor, but boxes test instead """ wraps = True - + + def fatals(self): + return None + def execute(self): def fun(): outcome = RunExecutor.execute(self) @@ -100,6 +108,9 @@ class AsyncExecutor(RunExecutor): computations (more async mode) """ wraps = True + + def fatals(self): + return None def execute(self): def fun():