Skip to content

Commit 154b941

Browse files
committed
TEST: Final few assert_raises
1 parent 0079255 commit 154b941

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

nibabel/cmdline/tests/test_utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
Test running scripts
66
"""
77

8-
from numpy.testing import assert_raises
9-
108
import pytest
119

1210
import nibabel as nib
@@ -196,10 +194,10 @@ def test_main():
196194
-7.24879837e+00]).astype(dtype="float32")]),
197195
('DATA(md5)', ['0a2576dd6badbb25bfb3b12076df986b', 'b0abbc492b4fd533b2c80d82570062cf'])])
198196

199-
with assert_raises(SystemExit):
197+
with pytest.raises(SystemExit):
200198
np.testing.assert_equal(main(test_names, StringIO()), expected_difference)
201199

202200
test_names_2 = [pjoin(data_path, f) for f in ('standard.nii.gz', 'standard.nii.gz')]
203201

204-
with assert_raises(SystemExit):
202+
with pytest.raises(SystemExit):
205203
assert main(test_names_2, StringIO()) == "These files are identical."

nibabel/tests/test_wrapstruct.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,14 +476,14 @@ def test_log_checks(self):
476476
assert fhdr['an_integer'] == 1
477477
assert (message ==
478478
'an_integer should be 1; set an_integer to 1')
479-
assert_raises(*raiser)
479+
pytest.raises(*raiser)
480480
# lower case string
481481
hdr = HC()
482482
hdr['a_str'] = 'Hello' # severity = 20
483483
fhdr, message, raiser = self.log_chk(hdr, 20)
484484
assert (message == 'a_str should be lower case; '
485485
'set a_str to lower case')
486-
assert_raises(*raiser)
486+
pytest.raises(*raiser)
487487

488488
def test_logger_error(self):
489489
# Check that we can reset the logger and error level

0 commit comments

Comments
 (0)