Skip to content

Commit 2ec3b7f

Browse files
committed
adding test that updates task inputs during a simple call - task()
1 parent ec52c40 commit 2ec3b7f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

pydra/engine/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def __call__(self, submitter=None, plugin=None, **kwargs):
281281
return res
282282

283283
def _run(self, **kwargs):
284-
# self.inputs = dc.replace(self.inputs, **kwargs) don't need it?
284+
self.inputs = dc.replace(self.inputs, **kwargs)
285285
checksum = self.checksum
286286
lockfile = self.cache_dir / (checksum + ".lock")
287287
# Eagerly retrieve cached

pydra/engine/tests/test_node_task.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,19 @@ def test_task_nostate_1_call_plug(plugin):
213213
assert nn.output_dir.exists()
214214

215215

216+
def test_task_nostate_1_call_updateinp():
217+
""" task without splitter"""
218+
nn = fun_addtwo(name="NA", a=30)
219+
# updating input when calling the node
220+
nn(a=3)
221+
222+
# checking the results
223+
results = nn.result()
224+
assert results.output.out == 5
225+
# checking the output_dir
226+
assert nn.output_dir.exists()
227+
228+
216229
@pytest.mark.parametrize("plugin", Plugins)
217230
def test_task_nostate_2(plugin):
218231
""" task with a list as an input, but no splitter"""

0 commit comments

Comments
 (0)