Skip to content

Commit 42beb1a

Browse files
committed
TEST: Simplify giftiio deprecation tests
1 parent dc9d82e commit 42beb1a

File tree

1 file changed

+9
-24
lines changed

1 file changed

+9
-24
lines changed

nibabel/gifti/tests/test_giftiio.py

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,16 @@
77
#
88
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
99

10-
import warnings
10+
from ..giftiio import read, write
11+
from .test_parse_gifti_fast import DATA_FILE1
1112

12-
from nibabel.testing import clear_and_catch_warnings
13-
from nibabel.tmpdirs import InTemporaryDirectory
13+
import pytest
1414

1515

16-
from .test_parse_gifti_fast import (DATA_FILE1, DATA_FILE2, DATA_FILE3,
17-
DATA_FILE4, DATA_FILE5, DATA_FILE6)
18-
19-
20-
class TestGiftiIO(object):
21-
22-
def setUp(self):
23-
with clear_and_catch_warnings() as w:
24-
warnings.simplefilter('always', DeprecationWarning)
25-
assert len(w) == 1
26-
27-
28-
def test_read_deprecated():
29-
with clear_and_catch_warnings() as w:
30-
warnings.simplefilter('always', DeprecationWarning)
31-
from nibabel.gifti.giftiio import read, write
32-
16+
def test_read_deprecated(tmp_path):
17+
with pytest.deprecated_call():
3318
img = read(DATA_FILE1)
34-
assert len(w) == 1
35-
with InTemporaryDirectory():
36-
write(img, 'test.gii')
37-
assert len(w) == 2
19+
20+
fname = tmp_path / 'test.gii'
21+
with pytest.deprecated_call():
22+
write(img, fname)

0 commit comments

Comments
 (0)