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():
85
85
assert out_fn_test == out_fn_true
86
86
87
87
88
- def test_b0dwi_for_fmap (tmpdir , capfd ):
88
+ def test_b0dwi_for_fmap (tmpdir , caplog ):
89
89
"""Make sure we raise a warning when .bvec and .bval files
90
90
are present but the modality is not dwi.
91
91
We check it by extracting a few DICOMs from a series with
92
92
bvals: 5 5 1500
93
93
"""
94
+ import logging
95
+ caplog .set_level (logging .WARNING )
94
96
tmppath = tmpdir .strpath
95
97
subID = 'b0dwiForFmap'
96
98
args = (
@@ -101,9 +103,8 @@ def test_b0dwi_for_fmap(tmpdir, capfd):
101
103
102
104
# assert that it raised a warning that the fmap directory will contain
103
105
# bvec and bval files.
104
- output = capfd .readouterr ().err .split ('\n ' )
105
106
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 )
107
108
108
109
# check that both 'fmap' and 'dwi' directories have been extracted and they contain
109
110
# *.bvec and a *.bval files
You can’t perform that action at this time.
0 commit comments