Fix tests for testtools 2.8.0 compatibility

From 2.8.0 testtools, testcase.TestSkipped has been removed we are
advice to replace with testcase.TestSkipped with unittest.skipTest

This PR trying to fix tests that are using TestSkipped by replacing it
with unittest.skipTest..

Closes-Bug: #2131281
Change-Id: I3bbdab71ec47f9c6ac99698aa1225239e7226706
Signed-off-by: Abhishek Bongale <abhishekbongale@outlook.com>
This commit is contained in:
Abhishek Bongale
2025-12-03 17:11:06 +00:00
parent 7cc9ef2b96
commit 8e2e854051

View File

@@ -407,7 +407,7 @@ class TestTempestBaseTestClass(base.TestCase):
def get_identity_version(cls):
return identity_version
with testtools.ExpectedException(testtools.testcase.TestSkipped):
with testtools.ExpectedException(unittest.SkipTest):
NeedAdmin().skip_checks()
mock_iaa.assert_called_once_with('identity_version')
@@ -417,7 +417,7 @@ class TestTempestBaseTestClass(base.TestCase):
class NeedV2(self.parent_test):
identity_version = 'v2'
with testtools.ExpectedException(testtools.testcase.TestSkipped):
with testtools.ExpectedException(unittest.SkipTest):
NeedV2().skip_checks()
def test_skip_checks_identity_v3_not_available(self):
@@ -426,7 +426,7 @@ class TestTempestBaseTestClass(base.TestCase):
class NeedV3(self.parent_test):
identity_version = 'v3'
with testtools.ExpectedException(testtools.testcase.TestSkipped):
with testtools.ExpectedException(unittest.SkipTest):
NeedV3().skip_checks()
def test_setup_credentials_all(self):