Skip to content

Commit f0a3889

Browse files
committed
Added one test back in
1 parent 41c6928 commit f0a3889

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

nipype/pipeline/plugins/tests/test_multiproc.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,27 @@ def _list_outputs(self):
3434
return outputs
3535

3636

37-
#def test_run_multiproc():
38-
# cur_dir = os.getcwd()
39-
# temp_dir = mkdtemp(prefix='test_engine_')
40-
# os.chdir(temp_dir)
41-
#
42-
# pipe = pe.Workflow(name='pipe')
43-
# mod1 = pe.Node(interface=TestInterface(), name='mod1')
44-
# mod2 = pe.MapNode(interface=TestInterface(),
45-
# iterfield=['input1'],
46-
# name='mod2')
47-
# pipe.connect([(mod1, mod2, [('output1', 'input1')])])
48-
# pipe.base_dir = os.getcwd()
49-
# mod1.inputs.input1 = 1
50-
# pipe.config['execution']['poll_sleep_duration'] = 2
51-
# execgraph = pipe.run(plugin="MultiProc")
52-
# names = ['.'.join((node._hierarchy, node.name)) for node in execgraph.nodes()]
53-
# node = execgraph.nodes()[names.index('pipe.mod1')]
54-
# result = node.get_output('output1')
55-
# yield assert_equal, result, [1, 1]
56-
# os.chdir(cur_dir)
57-
# rmtree(temp_dir)
37+
def test_run_multiproc():
38+
cur_dir = os.getcwd()
39+
temp_dir = mkdtemp(prefix='test_engine_')
40+
os.chdir(temp_dir)
41+
42+
pipe = pe.Workflow(name='pipe')
43+
mod1 = pe.Node(interface=TestInterface(), name='mod1')
44+
mod2 = pe.MapNode(interface=TestInterface(),
45+
iterfield=['input1'],
46+
name='mod2')
47+
pipe.connect([(mod1, mod2, [('output1', 'input1')])])
48+
pipe.base_dir = os.getcwd()
49+
mod1.inputs.input1 = 1
50+
pipe.config['execution']['poll_sleep_duration'] = 2
51+
execgraph = pipe.run(plugin="MultiProc")
52+
names = ['.'.join((node._hierarchy, node.name)) for node in execgraph.nodes()]
53+
node = execgraph.nodes()[names.index('pipe.mod1')]
54+
result = node.get_output('output1')
55+
yield assert_equal, result, [1, 1]
56+
os.chdir(cur_dir)
57+
rmtree(temp_dir)
5858

5959

6060
class InputSpecSingleNode(nib.TraitedSpec):

0 commit comments

Comments
 (0)