File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -85,12 +85,14 @@ def test_update_uncombined_name():
8585 assert out_fn_test == out_fn_true
8686
8787
88- def test_b0dwi_for_fmap (tmpdir , capfd ):
88+ def test_b0dwi_for_fmap (tmpdir , caplog ):
8989 """Make sure we raise a warning when .bvec and .bval files
9090 are present but the modality is not dwi.
9191 We check it by extracting a few DICOMs from a series with
9292 bvals: 5 5 1500
9393 """
94+ import logging
95+ caplog .set_level (logging .WARNING )
9496 tmppath = tmpdir .strpath
9597 subID = 'b0dwiForFmap'
9698 args = (
@@ -101,9 +103,8 @@ def test_b0dwi_for_fmap(tmpdir, capfd):
101103
102104 # assert that it raised a warning that the fmap directory will contain
103105 # bvec and bval files.
104- output = capfd .readouterr ().err .split ('\n ' )
105106 expected_msg = DW_IMAGE_IN_FMAP_FOLDER_WARNING .format (folder = op .join (tmppath , 'sub-%s' , 'fmap' ) % subID )
106- assert [ o for o in output if expected_msg in o ]
107+ assert any ( expected_msg in c . message for c in caplog . records )
107108
108109 # check that both 'fmap' and 'dwi' directories have been extracted and they contain
109110 # *.bvec and a *.bval files
You can’t perform that action at this time.
0 commit comments