[svn r38113] Make fatal() attribute which makes boxed tests catch SystemExit, while
in-process let it slide. --HG-- branch : trunk
This commit is contained in:
parent
632cc727e4
commit
1e6016ccc2
|
@ -23,12 +23,17 @@ class RunExecutor(object):
|
|||
def run(self):
|
||||
self.item.run()
|
||||
|
||||
def fatals(self):
|
||||
return (SystemExit, KeyboardInterrupt)
|
||||
|
||||
def execute(self):
|
||||
try:
|
||||
self.run()
|
||||
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):
|
||||
|
@ -79,6 +84,9 @@ class BoxExecutor(RunExecutor):
|
|||
"""
|
||||
wraps = True
|
||||
|
||||
def fatals(self):
|
||||
return None
|
||||
|
||||
def execute(self):
|
||||
def fun():
|
||||
outcome = RunExecutor.execute(self)
|
||||
|
@ -101,6 +109,9 @@ class AsyncExecutor(RunExecutor):
|
|||
"""
|
||||
wraps = True
|
||||
|
||||
def fatals(self):
|
||||
return None
|
||||
|
||||
def execute(self):
|
||||
def fun():
|
||||
outcome = RunExecutor.execute(self)
|
||||
|
|
Loading…
Reference in New Issue