Skip to content

Commit c46e1f4

Browse files
committed
TEST: Validate NIPYPE_NO_ET when NIPYPE_NO_ET is set
1 parent f864267 commit c46e1f4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

nipype/tests/test_nipype.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,28 @@ def test_no_et(tmp_path):
4646
from nipype.interfaces import utility as niu
4747
from nipype.interfaces.base import BaseInterface
4848

49+
et = os.getenv("NIPYPE_NO_ET") is None
50+
4951
# Pytest doesn't trigger this, so let's pretend it's there
5052
with patch.object(BaseInterface, "_etelemetry_version_data", {}):
5153

5254
# Direct function call - environment not set
5355
f = niu.Function(function=_check_no_et)
5456
res = f.run()
55-
assert res.outputs.out is True
57+
assert res.outputs.out == et
5658

5759
# Basic node - environment not set
5860
n = pe.Node(
5961
niu.Function(function=_check_no_et), name="n", base_dir=str(tmp_path)
6062
)
6163
res = n.run()
62-
assert res.outputs.out is True
64+
assert res.outputs.out == et
6365

6466
# Linear run - environment not set
6567
wf1 = pe.Workflow(name="wf1", base_dir=str(tmp_path))
6668
wf1.add_nodes([pe.Node(niu.Function(function=_check_no_et), name="n")])
6769
res = wf1.run()
68-
assert next(iter(res.nodes)).result.outputs.out is True
70+
assert next(iter(res.nodes)).result.outputs.out == et
6971

7072
# MultiProc run - environment initialized with NIPYPE_NO_ET
7173
wf2 = pe.Workflow(name="wf2", base_dir=str(tmp_path))
@@ -91,9 +93,9 @@ def test_no_et(tmp_path):
9193
]
9294
)
9395
res = wf4.run(plugin="MultiProc", plugin_args={"n_procs": 1})
94-
assert next(iter(res.nodes)).result.outputs.out is True
96+
assert next(iter(res.nodes)).result.outputs.out == et
9597

96-
# LegacyMultiProc run - environment initialized with NIPYPE_NO_ET
98+
# run_without_submitting - environment not set
9799
wf5 = pe.Workflow(name="wf5", base_dir=str(tmp_path))
98100
wf5.add_nodes(
99101
[
@@ -105,4 +107,4 @@ def test_no_et(tmp_path):
105107
]
106108
)
107109
res = wf5.run(plugin="LegacyMultiProc", plugin_args={"n_procs": 1})
108-
assert next(iter(res.nodes)).result.outputs.out is True
110+
assert next(iter(res.nodes)).result.outputs.out == et

0 commit comments

Comments
 (0)