[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
|
@ -22,6 +22,9 @@ class RunExecutor(object):
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.item.run()
|
self.item.run()
|
||||||
|
|
||||||
|
def fatals(self):
|
||||||
|
return (SystemExit, KeyboardInterrupt)
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
try:
|
try:
|
||||||
|
@ -29,6 +32,8 @@ class RunExecutor(object):
|
||||||
outcome = Outcome()
|
outcome = Outcome()
|
||||||
except Skipped, e:
|
except Skipped, e:
|
||||||
outcome = Outcome(skipped=str(e))
|
outcome = Outcome(skipped=str(e))
|
||||||
|
except self.fatals():
|
||||||
|
raise
|
||||||
except:
|
except:
|
||||||
excinfo = py.code.ExceptionInfo()
|
excinfo = py.code.ExceptionInfo()
|
||||||
if isinstance(self.item, py.test.Function):
|
if isinstance(self.item, py.test.Function):
|
||||||
|
@ -78,7 +83,10 @@ class BoxExecutor(RunExecutor):
|
||||||
""" Same as RunExecutor, but boxes test instead
|
""" Same as RunExecutor, but boxes test instead
|
||||||
"""
|
"""
|
||||||
wraps = True
|
wraps = True
|
||||||
|
|
||||||
|
def fatals(self):
|
||||||
|
return None
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
def fun():
|
def fun():
|
||||||
outcome = RunExecutor.execute(self)
|
outcome = RunExecutor.execute(self)
|
||||||
|
@ -100,6 +108,9 @@ class AsyncExecutor(RunExecutor):
|
||||||
computations (more async mode)
|
computations (more async mode)
|
||||||
"""
|
"""
|
||||||
wraps = True
|
wraps = True
|
||||||
|
|
||||||
|
def fatals(self):
|
||||||
|
return None
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
def fun():
|
def fun():
|
||||||
|
|
Loading…
Reference in New Issue