Skip to content

Commit 0a8701a

Browse files
committed
TEST: Drop unittest.TestCase base class; pytest does not need it
1 parent 85de727 commit 0a8701a

File tree

3 files changed

+2
-17
lines changed

3 files changed

+2
-17
lines changed

nibabel/testing/__init__.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -210,19 +210,6 @@ def assert_arr_dict_equal(dict1, dict2):
210210
assert_array_equal(value1, value2)
211211

212212

213-
class BaseTestCase(unittest.TestCase):
214-
"""TestCase that does not attempt to run if prefixed with a ``_``
215-
216-
This restores the nose-like behavior of skipping so-named test cases
217-
in test runners like pytest.
218-
"""
219-
220-
def setUp(self):
221-
if self.__class__.__name__.startswith('_'):
222-
raise unittest.SkipTest('Base test case - subclass to run')
223-
super().setUp()
224-
225-
226213
def expires(version):
227214
"""Decorator to mark a test as xfail with ExpiredDeprecationError after version"""
228215
from packaging.version import Version

nibabel/tests/test_spatialimages.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import warnings
1313
from io import BytesIO
14-
from unittest import TestCase
1514

1615
import numpy as np
1716
import pytest
@@ -205,7 +204,7 @@ def __array__(self, dtype='int16'):
205204
return np.arange(3, dtype=dtype)
206205

207206

208-
class TestSpatialImage(TestCase):
207+
class TestSpatialImage:
209208
# class for testing images
210209
image_class = SpatialImage
211210
can_save = False

nibabel/tests/test_wrapstruct.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
from .. import imageglobals
3434
from ..batteryrunners import Report
3535
from ..spatialimages import HeaderDataError
36-
from ..testing import BaseTestCase
3736
from ..volumeutils import Recoder, native_code, swapped_code
3837
from ..wrapstruct import LabeledWrapStruct, WrapStruct, WrapStructError
3938

@@ -101,7 +100,7 @@ def log_chk(hdr, level):
101100
return hdrc, message, raiser
102101

103102

104-
class _TestWrapStructBase(BaseTestCase):
103+
class _TestWrapStructBase:
105104
"""Class implements base tests for binary headers
106105
107106
It serves as a base class for other binary header tests

0 commit comments

Comments
 (0)