Replace use of testtools.testcase.TestSkipped

This has been deprecated for removal [1]. Use the stdlib variant
instead.

[1] https://github.com/testing-cabal/testtools/commit/59b890db3c

Change-Id: I14f17531212aa7407b9c023528ba20169f5ee21d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2024-06-24 10:50:29 +01:00
parent a01bb73d5f
commit 50bbf96772
2 changed files with 7 additions and 5 deletions

View File

@ -18,7 +18,9 @@ Functional test cases for the Barbican key manager.
Note: This requires local running instances of Barbican and Keystone.
"""
import abc
import unittest
from keystoneauth1 import identity
from keystoneauth1 import session
@ -26,7 +28,6 @@ from oslo_config import cfg
from oslo_context import context
from oslo_utils import uuidutils
from oslotest import base
from testtools import testcase
from castellan.common.credentials import keystone_password
from castellan.common.credentials import keystone_token
@ -59,7 +60,7 @@ class BarbicanKeyManagerTestCase(test_key_manager.KeyManagerTestCase):
except Exception as e:
# When we run functional-vault target, This test class needs
# to be skipped as barbican is not running
raise testcase.TestSkipped(str(e))
raise unittest.SkipTest(str(e))
def tearDown(self):
super(BarbicanKeyManagerTestCase, self).tearDown()

View File

@ -15,14 +15,15 @@ Functional test cases for the Vault key manager.
Note: This requires local running instance of Vault.
"""
import os
import unittest
import uuid
from oslo_config import cfg
from oslo_utils import uuidutils
from oslotest import base
import requests
from testtools import testcase
from castellan.common import exception
from castellan.key_manager import vault_key_manager
@ -39,7 +40,7 @@ class VaultKeyManagerTestCase(test_key_manager.KeyManagerTestCase,
if ('VAULT_TEST_URL' not in os.environ or
'VAULT_TEST_ROOT_TOKEN' not in os.environ):
raise testcase.TestSkipped('Missing Vault setup information')
raise unittest.SkipTest('Missing Vault setup information')
key_mgr._root_token_id = os.environ['VAULT_TEST_ROOT_TOKEN']
key_mgr._vault_url = os.environ['VAULT_TEST_URL']
@ -90,7 +91,7 @@ class VaultKeyManagerAppRoleTestCase(VaultKeyManagerTestCase):
if ('VAULT_TEST_URL' not in os.environ or
'VAULT_TEST_ROOT_TOKEN' not in os.environ):
raise testcase.TestSkipped('Missing Vault setup information')
raise unittest.SkipTest('Missing Vault setup information')
self.root_token_id = os.environ['VAULT_TEST_ROOT_TOKEN']
self.vault_url = os.environ['VAULT_TEST_URL']