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
5 files changed