Skip to content

Commit 841dcf8

Browse files
committed
TST: Exercise process initializer option
1 parent f2b262e commit 841dcf8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

niworkflows/engine/tests/test_plugin.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,22 @@ def test_plugin_args_noconfig(workflow, caplog):
7878
)
7979

8080

81-
def test_plugin_app_config(workflow, caplog):
81+
def test_plugin_app_config(workflow, caplog, capsys):
8282
"""Test the plugin works with a nipreps-style configuration."""
83+
84+
def init_print():
85+
print("Custom init")
86+
8387
app_config = SimpleNamespace(
8488
environment=SimpleNamespace(total_memory_gb=1),
85-
_process_initializer=lambda x: None,
89+
_process_initializer=init_print(),
8690
file_path='/does/not/need/to/exist/for/testing',
8791
)
8892
caplog.set_level(logging.CRITICAL, logger="nipype.workflow")
8993
workflow.run(
9094
plugin=MultiProcPlugin(),
9195
plugin_args={"n_procs": 2, "app_config": app_config},
9296
)
97+
98+
captured = capsys.readouterr()
99+
assert "Custom init" in captured.out

0 commit comments

Comments
 (0)