1
+ import os
1
2
from .. import get_info
2
3
from ..info import get_nipype_gitversion
3
4
import pytest
@@ -46,26 +47,28 @@ def test_no_et(tmp_path):
46
47
from nipype .interfaces import utility as niu
47
48
from nipype .interfaces .base import BaseInterface
48
49
50
+ et = os .getenv ("NIPYPE_NO_ET" ) is None
51
+
49
52
# Pytest doesn't trigger this, so let's pretend it's there
50
53
with patch .object (BaseInterface , "_etelemetry_version_data" , {}):
51
54
52
55
# Direct function call - environment not set
53
56
f = niu .Function (function = _check_no_et )
54
57
res = f .run ()
55
- assert res .outputs .out is True
58
+ assert res .outputs .out == et
56
59
57
60
# Basic node - environment not set
58
61
n = pe .Node (
59
62
niu .Function (function = _check_no_et ), name = "n" , base_dir = str (tmp_path )
60
63
)
61
64
res = n .run ()
62
- assert res .outputs .out is True
65
+ assert res .outputs .out == et
63
66
64
67
# Linear run - environment not set
65
68
wf1 = pe .Workflow (name = "wf1" , base_dir = str (tmp_path ))
66
69
wf1 .add_nodes ([pe .Node (niu .Function (function = _check_no_et ), name = "n" )])
67
70
res = wf1 .run ()
68
- assert next (iter (res .nodes )).result .outputs .out is True
71
+ assert next (iter (res .nodes )).result .outputs .out == et
69
72
70
73
# MultiProc run - environment initialized with NIPYPE_NO_ET
71
74
wf2 = pe .Workflow (name = "wf2" , base_dir = str (tmp_path ))
@@ -91,9 +94,9 @@ def test_no_et(tmp_path):
91
94
]
92
95
)
93
96
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
95
98
96
- # LegacyMultiProc run - environment initialized with NIPYPE_NO_ET
99
+ # run_without_submitting - environment not set
97
100
wf5 = pe .Workflow (name = "wf5" , base_dir = str (tmp_path ))
98
101
wf5 .add_nodes (
99
102
[
@@ -105,4 +108,4 @@ def test_no_et(tmp_path):
105
108
]
106
109
)
107
110
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