提交 037ab398 编写于 作者: A Amador Pahim

test: flag that test is being skipped

Now that the teardown() is always called, we have to explicitly flag
when it should be skipped. That's the case when someone decorates the
setUp() with a skip decorator or when someone calls self.skip() in
setUp().

Reference: https://trello.com/c/B6DJe0JSSigned-off-by: NAmador Pahim <apahim@redhat.com>
上级 a2d17ab4
......@@ -588,6 +588,7 @@ class Test(unittest.TestCase):
if skip_test is False:
self.setUp()
except (exceptions.TestSetupSkip, exceptions.TestSkipError) as details:
skip_test = True
stacktrace.log_exc_info(sys.exc_info(), logger=LOG_JOB)
raise exceptions.TestSkipError(details)
except exceptions.TestCancel as details:
......
......@@ -25,8 +25,6 @@ ALL_MESSAGES = ['setup pre',
# [msg_in, ...])
EXPECTED_RESULTS = {'skip-setup-d304': ('SKIP',
['setup pre',
'teardown pre',
'teardown post',
"[WARNING: self.skip() will be "
"deprecated. Use 'self.cancel()' "
"or the skip decorators]"]),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册