avocado.test: Raise TestSetupFail on both setup and cleanup

Since both can possibly fail and mask the actual test
results.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 e3496f55
......@@ -44,7 +44,7 @@ class TestBaseException(Exception):
class TestSetupFail(TestBaseException):
"""
Indicates an error during a setup procedure.
Indicates an error during a setup or cleanup procedure.
"""
status = "ERROR"
......
......@@ -200,7 +200,10 @@ class Test(unittest.TestCase):
except Exception, details:
raise exceptions.TestSetupFail(details)
self.action()
self.cleanup()
try:
self.cleanup()
except Exception, details:
raise exceptions.TestSetupFail(details)
self.status = 'PASS'
def run_avocado(self, result=None):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册