Skip to content

Commit d03210e

Browse files
committed
tst: clean up test
1 parent f902bff commit d03210e

File tree

1 file changed

+13
-26
lines changed

1 file changed

+13
-26
lines changed

petprep/reports/tests/test_reports.py

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -118,35 +118,22 @@ def mock_session_list(*args, **kwargs):
118118
def test_pet_report(tmp_path, monkeypatch):
119119
fake_uuid = 'fake_uuid'
120120

121-
pet_source = data_dir / 'work/reportlets/petprep'
121+
pet_source = data_dir / 'work' / 'reportlets' / 'petprep' / 'sub-01'
122122
sub_dir = tmp_path / 'sub-01' / 'figures'
123123
sub_dir.mkdir(parents=True)
124124

125-
shutil.copy2(
126-
pet_source / 'sub-01/sub-01_desc-about_T1w.html', sub_dir / 'sub-01_desc-about_T1w.html'
127-
)
128-
shutil.copy2(
129-
pet_source / 'sub-01/sub-01_desc-summary_pet.html',
130-
sub_dir / 'sub-01_desc-summary_pet.html',
131-
)
132-
shutil.copy2(
133-
pet_source / 'sub-01/sub-01_desc-validation_pet.html',
134-
sub_dir / 'sub-01_desc-validation_pet.html',
135-
)
136-
shutil.copy2(
137-
pet_source / 'sub-01/sub-01_desc-carpetplot_pet.svg',
138-
sub_dir / 'sub-01_desc-carpetplot_pet.svg',
139-
)
140-
shutil.copy2(
141-
pet_source / 'sub-01/sub-01_desc-confoundcorr_pet.svg',
142-
sub_dir / 'sub-01_desc-confoundcorr_pet.svg',
143-
)
144-
shutil.copy2(
145-
pet_source / 'sub-01/sub-01_desc-coreg_pet.svg', sub_dir / 'sub-01_desc-coreg_pet.svg'
146-
)
147-
148-
config.execution.aggr_ses_reports = 4
149-
config.execution.layout = BIDSLayout(data_dir / 'ds000005')
125+
for fl in [
126+
'sub-01_desc-about_T1w.html',
127+
'sub-01_desc-summary_pet.html',
128+
'sub-01_desc-validation_pet.html',
129+
'sub-01_desc-carpetplot_pet.svg',
130+
'sub-01_desc-confoundcorr_pet.svg',
131+
'sub-01_desc-coreg_pet.svg',
132+
]:
133+
shutil.copy2(pet_source / fl, sub_dir / fl)
134+
135+
monkeypatch.setattr(config.execution, 'aggr_ses_reports', 4)
136+
monkeypatch.setattr(config.execution, 'layout', BIDSLayout(data_dir / 'ds000005'))
150137
monkeypatch.setattr(config.execution, 'bids_filters', {'pet': {'session': ['baseline']}})
151138

152139
failed_reports = generate_reports(['01'], tmp_path, fake_uuid)

0 commit comments

Comments
 (0)