Skip to content

Commit 8d24e60

Browse files
STY: Apply ruff/refurb rule FURB118
FURB118 Use `operator.add` instead of defining a function
1 parent ed7ec51 commit 8d24e60

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

niworkflows/engine/tests/test_plugin.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import operator
23
from types import SimpleNamespace
34

45
import pytest
@@ -8,10 +9,6 @@
89
from ..plugin import MultiProcPlugin
910

1011

11-
def add(x, y):
12-
return x + y
13-
14-
1512
def addall(inlist):
1613
import time
1714

@@ -28,7 +25,7 @@ def workflow(tmp_path):
2825

2926
# Generate many nodes and claim a lot of memory
3027
add_nd = pe.MapNode(
31-
niu.Function(function=add, input_names=['x', 'y'], output_names=['z']),
28+
niu.Function(function=operator.add, input_names=['x', 'y'], output_names=['z']),
3229
name='add',
3330
iterfield=['x'],
3431
mem_gb=0.8,
@@ -39,7 +36,7 @@ def workflow(tmp_path):
3936

4037
# Run without submitting is another code path
4138
add_more_nd = pe.Node(
42-
niu.Function(function=add, input_names=['x', 'y'], output_names=['z']),
39+
niu.Function(function=operator.add, input_names=['x', 'y'], output_names=['z']),
4340
name='add_more',
4441
run_without_submitting=True,
4542
)

0 commit comments

Comments
 (0)