Skip to content

Commit ee70359

Browse files
committed
Removed print statements from fakes3 checker and made it a check at the beginning
1 parent ecb05e2 commit ee70359

File tree

1 file changed

+11
-28
lines changed

1 file changed

+11
-28
lines changed

nipype/interfaces/tests/test_io.py

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@
3434
except:
3535
noboto3 = True
3636

37+
# Check for fakes3
38+
import subprocess
39+
try:
40+
ret_code = subprocess.check_call(['which', 'fakes3'], stdout=open(os.devnull, 'wb'))
41+
if ret_code == 0:
42+
fakes3_found = True
43+
else:
44+
fakes3_found = False
45+
except:
46+
fakes3_found = False
47+
3748
def test_datagrabber():
3849
dg = nio.DataGrabber()
3950
yield assert_equal, dg.inputs.template, Undefined
@@ -173,30 +184,6 @@ def test_datasink():
173184
ds = nio.DataSink(infields=['test'])
174185
yield assert_true, 'test' in ds.inputs.copyable_trait_names()
175186

176-
# Function to check for fakes3
177-
def _check_for_fakes3():
178-
'''
179-
Function used internally to check for fakes3 installation
180-
'''
181-
182-
# Import packages
183-
import subprocess
184-
185-
# Init variables
186-
fakes3_found = False
187-
188-
# Check for fakes3
189-
try:
190-
ret_code = subprocess.check_call(['which', 'fakes3'], stdout=open(os.devnull, 'wb'))
191-
if ret_code == 0:
192-
fakes3_found = True
193-
except subprocess.CalledProcessError as exc:
194-
print 'fakes3 not found, install via \'gem install fakes3\', skipping test...'
195-
except:
196-
print 'Unable to check for fakes3 installation, skipping test...'
197-
198-
# Return if found
199-
return fakes3_found
200187

201188
def _make_dummy_input():
202189
'''
@@ -216,10 +203,6 @@ def _make_dummy_input():
216203
# Return path
217204
return input_path
218205

219-
# Check for fakes3
220-
fakes3 = _check_for_fakes3()
221-
222-
223206
@skipif(noboto3 or not fakes3)
224207
# Test datasink writes to s3 properly
225208
def test_datasink_to_s3():

0 commit comments

Comments
 (0)