Skip to content

Commit eb1c4bd

Browse files
committed
ensure all the figures are copied over
1 parent 2eeb8cc commit eb1c4bd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

niworkflows/reports/tests/test_core.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import matplotlib.pyplot as plt
1111
from bids.layout.writing import build_path
12+
from bids.layout import BIDSLayout
1213

1314
import pytest
1415

@@ -204,9 +205,12 @@ def test_generated_reportlets(bids_sessions, ordering):
204205
needed_entities = ['session', 'task', 'ceagent', 'run']
205206
# the last section is the most recently run
206207
reportlets_num = len(report.sections[-1].reportlets)
208+
# get the number of figures in the output directory
209+
out_layout = BIDSLayout(out_dir, config='figures', validate=False)
210+
out_figs = len(out_layout.get())
207211
# if ordering does not contain all the relevent entities
208212
# then there should be fewer reportlets than expected
209213
if all(ent in ordering for ent in needed_entities):
210-
assert reportlets_num == expected_reportlets_num
214+
assert reportlets_num == expected_reportlets_num == out_figs
211215
else:
212-
assert reportlets_num < expected_reportlets_num
216+
assert reportlets_num < expected_reportlets_num == out_figs

0 commit comments

Comments
 (0)