1+ import os
12from .. import get_info
23from ..info import get_nipype_gitversion
34import pytest
@@ -46,26 +47,28 @@ def test_no_et(tmp_path):
4647 from nipype .interfaces import utility as niu
4748 from nipype .interfaces .base import BaseInterface
4849
50+ et = os .getenv ("NIPYPE_NO_ET" ) is None
51+
4952 # Pytest doesn't trigger this, so let's pretend it's there
5053 with patch .object (BaseInterface , "_etelemetry_version_data" , {}):
5154
5255 # Direct function call - environment not set
5356 f = niu .Function (function = _check_no_et )
5457 res = f .run ()
55- assert res .outputs .out is True
58+ assert res .outputs .out == et
5659
5760 # Basic node - environment not set
5861 n = pe .Node (
5962 niu .Function (function = _check_no_et ), name = "n" , base_dir = str (tmp_path )
6063 )
6164 res = n .run ()
62- assert res .outputs .out is True
65+ assert res .outputs .out == et
6366
6467 # Linear run - environment not set
6568 wf1 = pe .Workflow (name = "wf1" , base_dir = str (tmp_path ))
6669 wf1 .add_nodes ([pe .Node (niu .Function (function = _check_no_et ), name = "n" )])
6770 res = wf1 .run ()
68- assert next (iter (res .nodes )).result .outputs .out is True
71+ assert next (iter (res .nodes )).result .outputs .out == et
6972
7073 # MultiProc run - environment initialized with NIPYPE_NO_ET
7174 wf2 = pe .Workflow (name = "wf2" , base_dir = str (tmp_path ))
@@ -91,9 +94,9 @@ def test_no_et(tmp_path):
9194 ]
9295 )
9396 res = wf4 .run (plugin = "MultiProc" , plugin_args = {"n_procs" : 1 })
94- assert next (iter (res .nodes )).result .outputs .out is True
97+ assert next (iter (res .nodes )).result .outputs .out == et
9598
96- # LegacyMultiProc run - environment initialized with NIPYPE_NO_ET
99+ # run_without_submitting - environment not set
97100 wf5 = pe .Workflow (name = "wf5" , base_dir = str (tmp_path ))
98101 wf5 .add_nodes (
99102 [
@@ -105,4 +108,4 @@ def test_no_et(tmp_path):
105108 ]
106109 )
107110 res = wf5 .run (plugin = "LegacyMultiProc" , plugin_args = {"n_procs" : 1 })
108- assert next (iter (res .nodes )).result .outputs .out is True
111+ assert next (iter (res .nodes )).result .outputs .out == et
0 commit comments