Skip to content

Commit 3d6fe57

Browse files
author
shariqiqbal2810
committed
Added skips to s3 tests for when boto3 is not present
1 parent b81cde8 commit 3d6fe57

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

nipype/interfaces/tests/test_io.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88

99
from nose.tools import assert_raises
1010
import nipype
11-
from nipype.testing import assert_equal, assert_true, assert_false
11+
from nipype.testing import assert_equal, assert_true, assert_false, skipif
1212
import nipype.interfaces.io as nio
1313
from nipype.interfaces.base import Undefined
1414

15+
noboto = False
1516
try:
1617
import boto3
1718
except:
19+
noboto = True
1820
pass
1921

2022

@@ -24,6 +26,7 @@ def test_datagrabber():
2426
yield assert_equal, dg.inputs.base_directory, Undefined
2527
yield assert_equal, dg.inputs.template_args, {'outfiles': []}
2628

29+
@skipif(noboto)
2730
def test_s3datagrabber():
2831
dg = nio.S3DataGrabber()
2932
yield assert_equal, dg.inputs.template, Undefined
@@ -83,6 +86,7 @@ def test_selectfiles_valueerror():
8386
force_lists=force_lists)
8487
yield assert_raises, ValueError, sf.run
8588

89+
@skipif(noboto)
8690
def test_s3datagrabber_communication():
8791
dg = nio.S3DataGrabber(infields=['subj_id', 'run_num'], outfields=['func', 'struct'])
8892
dg.inputs.bucket = 'openfmri'
@@ -113,7 +117,6 @@ def test_s3datagrabber_communication():
113117

114118
shutil.rmtree(tempdir)
115119

116-
117120
def test_datagrabber_order():
118121
tempdir = mkdtemp()
119122
file1 = mkstemp(prefix='sub002_L1_R1.q', dir=tempdir)
@@ -150,6 +153,7 @@ def test_datasink():
150153
ds = nio.DataSink(infields=['test'])
151154
yield assert_true, 'test' in ds.inputs.copyable_trait_names()
152155

156+
@skipif(noboto)
153157
def test_s3datasink():
154158
ds = nio.S3DataSink()
155159
yield assert_true, ds.inputs.parameterization
@@ -190,6 +194,7 @@ def test_datasink_substitutions():
190194
shutil.rmtree(indir)
191195
shutil.rmtree(outdir)
192196

197+
@skipif(noboto)
193198
def test_s3datasink_substitutions():
194199
indir = mkdtemp(prefix='-Tmp-nipype_ds_subs_in')
195200
outdir = mkdtemp(prefix='-Tmp-nipype_ds_subs_out')

0 commit comments

Comments
 (0)