tests: Remove unnecessary base class

Nothing was using it.

Change-Id: I5219ec6f6bce88b57bda7808720c1744951cc186
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane
2025-12-01 14:10:43 +00:00
parent a0352088e7
commit 0127b20b22
18 changed files with 22 additions and 63 deletions

View File

@@ -13,40 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import os
import fixtures
import testtools
_TRUE_VALUES = ('true', '1', 'yes')
# FIXME(dhellmann) Update this to use oslo.test library
from oslotest import base
class TestCase(testtools.TestCase):
"""Test case base class for all unit tests."""
def setUp(self):
"""Run before each test method to initialize test environment."""
super().setUp()
test_timeout = os.environ.get('OS_TEST_TIMEOUT', 0)
try:
test_timeout = int(test_timeout)
except ValueError:
# If timeout value is invalid do not set a timeout.
test_timeout = 0
if test_timeout > 0:
self.useFixture(fixtures.Timeout(test_timeout, gentle=True))
self.useFixture(fixtures.NestedTempfile())
self.useFixture(fixtures.TempHomeDir())
if os.environ.get('OS_STDOUT_CAPTURE') in _TRUE_VALUES:
stdout = self.useFixture(fixtures.StringStream('stdout')).stream
self.useFixture(fixtures.MonkeyPatch('sys.stdout', stdout))
if os.environ.get('OS_STDERR_CAPTURE') in _TRUE_VALUES:
stderr = self.useFixture(fixtures.StringStream('stderr')).stream
self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr))
self.log_fixture = self.useFixture(fixtures.FakeLogger())
class BaseTestCase(base.BaseTestCase): ...

View File

@@ -21,11 +21,11 @@ import tempfile
from unittest import mock
import ddt
from oslo_utils import units
from oslo_utils.imageutils import format_inspector
from oslo_utils.imageutils import QemuImgInfo
from oslotest import base as test_base
from oslo_utils.tests import base as test_base
from oslo_utils import units
TEST_IMAGE_PREFIX = 'oslo-unittest-formatinspector-'

View File

@@ -13,14 +13,14 @@
# License for the specific language governing permissions and limitations
# under the License.
from unittest import mock
import warnings
from oslotest import base as test_base
import testscenarios
from oslo_utils import imageutils
from oslo_utils.tests import base as test_base
from unittest import mock
load_tests = testscenarios.load_tests_apply_scenarios

View File

@@ -13,10 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslotest import base as test_base
from oslo_utils import dictutils as du
from oslo_utils.tests import base as test_base
class DictUtilsTestCase(test_base.BaseTestCase):

View File

@@ -18,9 +18,9 @@ import warnings
import eventlet
from eventlet import greenthread
from oslotest import base as test_base
from oslo_utils import eventletutils
from oslo_utils.tests import base as test_base
class EventletUtilsTest(test_base.BaseTestCase):

View File

@@ -16,9 +16,9 @@ import logging
from unittest import mock
import fixtures
from oslotest import base as test_base
from oslo_utils import excutils
from oslo_utils.tests import base as test_base
from oslo_utils import timeutils

View File

@@ -25,9 +25,8 @@ from unittest import mock
import uuid
import yaml
from oslotest import base as test_base
from oslo_utils import fileutils
from oslo_utils.tests import base as test_base
TEST_PERMISSIONS = stat.S_IRWXU

View File

@@ -15,11 +15,10 @@
import datetime
from oslotest import base as test_base
from oslo_utils import fixture
from oslo_utils.fixture import keystoneidsentinel as keystids
from oslo_utils.fixture import uuidsentinel as uuids
from oslo_utils.tests import base as test_base
from oslo_utils import timeutils
from oslo_utils import uuidutils

View File

@@ -16,9 +16,8 @@
import datetime
import sys
from oslotest import base as test_base
from oslo_utils import importutils
from oslo_utils.tests import base as test_base
class ImportUtilsTest(test_base.BaseTestCase):

View File

@@ -20,9 +20,9 @@ import socket
from unittest import mock
import netaddr
from oslotest import base as test_base
from oslo_utils import netutils
from oslo_utils.tests import base as test_base
class NetworkUtilsTest(test_base.BaseTestCase):

View File

@@ -14,9 +14,8 @@
import functools
from oslotest import base as test_base
from oslo_utils import reflection
from oslo_utils.tests import base as test_base
RUNTIME_ERROR_CLASSES = [

View File

@@ -15,10 +15,10 @@
import hashlib
import hmac
from oslotest import base as test_base
import testscenarios
from oslo_utils import secretutils
from oslo_utils.tests import base as test_base
def _gen_digest(text):

View File

@@ -10,9 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslotest import base as test_base
from oslo_utils import specs_matcher
from oslo_utils.tests import base as test_base
class SpecsMatcherTestCase(test_base.BaseTestCase):

View File

@@ -20,12 +20,13 @@ from typing import Any
from unittest import mock
import ddt
from oslotest import base as test_base
import testscenarios
from oslo_utils import strutils
from oslo_utils.tests import base as test_base
from oslo_utils import units
load_tests = testscenarios.load_tests_apply_scenarios

View File

@@ -19,9 +19,9 @@ import time
from unittest import mock
import iso8601
from oslotest import base as test_base
from testtools import matchers
from oslo_utils.tests import base as test_base
from oslo_utils import timeutils

View File

@@ -15,8 +15,7 @@
import uuid
from oslotest import base as test_base
from oslo_utils.tests import base as test_base
from oslo_utils import uuidutils

View File

@@ -13,8 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslotest import base as test_base
from oslo_utils.tests import base as test_base
from oslo_utils import versionutils

View File

@@ -16,9 +16,9 @@
from unittest import mock
from oslo_i18n import fixture as oslo_i18n_fixture
from oslotest import base as test_base
from oslo_utils import encodeutils
from oslo_utils.tests import base as test_base
class EncodeUtilsTest(test_base.BaseTestCase):