commit | e64c78dcf720202a0542bb1e1184f5229a11524f | [log] [tgz] |
---|---|---|
author | Ghanshyam Mann <gmann@ghanshyammann.com> | Thu Oct 10 22:26:43 2019 +0000 |
committer | Ghanshyam Mann <gmann@ghanshyammann.com> | Sat Oct 12 01:40:29 2019 +0000 |
tree | 80fc21946f62000cb933ec369a52b45a430cc8ca | |
parent | f1f1cd943c69cc771a3dff2625e89de4d746cbe1 [diff] [blame] |
Add workaround to handle the testtool skip exception in CLI test This commit apply the workaround for testtool skip exception in CLI test base class. - https://review.opendev.org/#/c/681340/6 I have modified the workaround done in above commit to more generic one. We are good on skipException from test code. That is handled by teststools.TestCase's self.exception_handlers - https://github.com/testing-cabal/testtools/blob/f51ce5f934153e80d3e8a95b52e1464daeb30c14/testtools/testcase.py#L275 Mapped handler _report_skip() will add the respective tests to skip list Current CLI test failure -https://zuul.opendev.org/t/openstack/build/c1bb61121e1d4d108c52adad200e8991/log/job-output.txt#6354 I have tested both test.BaseTestCase and lib.base.BaseTestCase with all 8 combinations of below: - py >= 3.5 and py < 3.5 (on py2.7) - stestr >= 2.50 and stestr < 2.5.0 - skip exception from setUpClass and skip exception from test code Closes-Bug: 1847749 Change-Id: Ib70bdffaf4d38743e7cbbeb88af51bb57ceeedf6
diff --git a/tempest/tests/test_test.py b/tempest/tests/test_test.py index a2e0efd..49fd010 100644 --- a/tempest/tests/test_test.py +++ b/tempest/tests/test_test.py
@@ -531,8 +531,8 @@ def test_skip_only(self): # If a skip condition is hit in the test, no credentials or resource # is provisioned / cleaned-up - exc, _ = test.BaseTestCase.handle_skip_exception() - self.mocks['skip_checks'].side_effect = (exc) + self.mocks['skip_checks'].side_effect = ( + testtools.TestCase.skipException()) suite = unittest.TestSuite((self.test,)) log = [] result = LoggingTestResult(log)