Skip to content

Commit 82c8588

Browse files
committed
Replace deprecated setup() and teardown()
Those were compatibility functions for porting from nose. They are now deprecated and have been removed from pytest. This will make all tests compatible with pytests 8.x.
1 parent f40ac39 commit 82c8588

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

nibabel/streamlines/tests/test_streamlines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
DATA = {}
2121

2222

23-
def setup():
23+
def setup_module():
2424
global DATA
2525
DATA['empty_filenames'] = [pjoin(data_path, 'empty' + ext) for ext in FORMATS.keys()]
2626
DATA['simple_filenames'] = [pjoin(data_path, 'simple' + ext) for ext in FORMATS.keys()]

nibabel/tests/test_deprecated.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
from nibabel.tests.test_deprecator import TestDeprecatorFunc as _TestDF
1515

1616

17-
def setup():
17+
def setup_module():
1818
# Hack nibabel version string
1919
pkg_info.cmp_pkg_version.__defaults__ = ('2.0',)
2020

2121

22-
def teardown():
22+
def teardown_module():
2323
# Hack nibabel version string back again
2424
pkg_info.cmp_pkg_version.__defaults__ = (pkg_info.__version__,)
2525

nibabel/tests/test_dft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
data_dir = pjoin(dirname(__file__), 'data')
2727

2828

29-
def setUpModule():
29+
def setup_module():
3030
if os.name == 'nt':
3131
raise unittest.SkipTest('FUSE not available for windows, skipping dft tests')
3232
if not have_dicom:

0 commit comments

Comments
 (0)