Skip to content

Commit b147981

Browse files
committed
TEST/FIX: Do not attempt to save artifacts when disabled
1 parent 075fa7e commit b147981

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

niworkflows/tests/test_viz.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def test_fmriplot(input_files):
140140
_cifti_timeseries(in_file)
141141
)
142142

143-
fMRIPlot(
143+
fig = fMRIPlot(
144144
timeseries,
145145
segments,
146146
tr=_get_tr(nb.load(in_file)),
@@ -151,10 +151,12 @@ def test_fmriplot(input_files):
151151
}),
152152
units={"FD": "mm"},
153153
paired_carpet=dtype == "cifti",
154-
).plot().savefig(
155-
os.path.join(save_artifacts, f"fmriplot_{dtype}{has_seg}.svg"),
156-
bbox_inches="tight",
157-
)
154+
).plot()
155+
if save_artifacts:
156+
fig.savefig(
157+
os.path.join(save_artifacts, f"fmriplot_{dtype}{has_seg}.svg"),
158+
bbox_inches="tight",
159+
)
158160

159161

160162
def test_plot_melodic_components(tmp_path):

0 commit comments

Comments
 (0)