From 788a0d1b9e3956235c071bef3c2c1bdc5ccaf541 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 22 Aug 2017 11:50:45 -0400 Subject: [PATCH] skip test when no s3 lib --- test/units/modules/cloud/amazon/test_s3.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/units/modules/cloud/amazon/test_s3.py b/test/units/modules/cloud/amazon/test_s3.py index 959596bc93e..57ed3e83b51 100644 --- a/test/units/modules/cloud/amazon/test_s3.py +++ b/test/units/modules/cloud/amazon/test_s3.py @@ -2,7 +2,12 @@ import pytest import unittest -import ansible.modules.cloud.amazon.s3 as s3 +try: + import ansible.modules.cloud.amazon.s3 as s3 +except ImportError: + from nose.plugins.skip import SkipTest + raise SkipTest("This test requires the s3 Python libraries") + from ansible.module_utils.six.moves.urllib.parse import urlparse boto3 = pytest.importorskip("boto3")