Skip to content

Commit 28688a1

Browse files
STY: Apply ruff rule RUF015
RUF015 Prefer `next(...)` over single element slice
1 parent a112dcc commit 28688a1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

niworkflows/func/tests/test_util.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ def test_masking(input_fname, expected_fname):
156156

157157
res = wf.run(plugin='MultiProc')
158158

159-
combine_masks = [node for node in res.nodes if node.name.endswith('combine_masks')][
160-
0
161-
]
159+
combine_masks = next(node for node in res.nodes if node.name.endswith('combine_masks'))
162160
overlap = symmetric_overlap(expected_fname, combine_masks.result.outputs.out_file)
163161

164162
mask_dir = reports_dir / 'fmriprep_bold_mask' / dsname

0 commit comments

Comments
 (0)