diff --git a/tests/helpers.py b/tests/helpers.py index 0f8df72fe..6cc38f5d5 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -8,6 +8,11 @@ def version_tuple(v): return tuple(map(int, (v.split(".")))) +# Note: See https://github.com/spulec/moto/issues/201 for why this is a separate method. +def skip_test(): + raise SkipTest + + class requires_boto_gte(object): """Decorator for requiring boto version greater than or equal to 'version'""" def __init__(self, version): @@ -18,7 +23,7 @@ class requires_boto_gte(object): required = version_tuple(self.version) if boto_version >= required: return test - raise SkipTest + return skip_test class py3_requires_boto_gte(object): @@ -34,4 +39,4 @@ class py3_requires_boto_gte(object): required = version_tuple(self.version) if boto_version >= required: return test - raise SkipTest + return skip_test diff --git a/tests/test_autoscaling/test_launch_configurations.py b/tests/test_autoscaling/test_launch_configurations.py index dc3e85ef5..d24480281 100644 --- a/tests/test_autoscaling/test_launch_configurations.py +++ b/tests/test_autoscaling/test_launch_configurations.py @@ -168,7 +168,6 @@ def test_create_launch_configuration_defaults(): launch_config.instance_monitoring.enabled.should.equal('false') launch_config.instance_profile_name.should.equal(None) launch_config.spot_price.should.equal(None) - launch_config.ebs_optimized.should.equal(False) @requires_boto_gte("2.12") diff --git a/tests/test_emr/test_emr.py b/tests/test_emr/test_emr.py index dd72b54b4..c8d5fca3b 100644 --- a/tests/test_emr/test_emr.py +++ b/tests/test_emr/test_emr.py @@ -92,6 +92,7 @@ def test_create_job_flow_with_new_params(): ) +@requires_boto_gte("2.8") @mock_emr def test_create_job_flow_visible_to_all_users(): conn = boto.connect_emr() @@ -99,7 +100,6 @@ def test_create_job_flow_visible_to_all_users(): job_id = conn.run_jobflow( name='My jobflow', log_uri='s3://some_bucket/jobflow_logs', - job_flow_role='some-role-arn', steps=[], visible_to_all_users=True, ) @@ -268,6 +268,7 @@ def test_modify_instance_groups(): int(instance_group2.instancerunningcount).should.equal(3) +@requires_boto_gte("2.8") @mock_emr def test_set_visible_to_all_users(): conn = boto.connect_emr() @@ -275,7 +276,6 @@ def test_set_visible_to_all_users(): job_id = conn.run_jobflow( name='My jobflow', log_uri='s3://some_bucket/jobflow_logs', - job_flow_role='some-role-arn', steps=[], visible_to_all_users=False, )