mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Skip test_aws.py if boto3/botocore are missing (#17814)
This commit is contained in:
parent
656b82417e
commit
8bf4aa97b0
1 changed files with 13 additions and 3 deletions
|
@ -16,12 +16,22 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import unittest
|
try:
|
||||||
import botocore
|
import boto3
|
||||||
import boto3
|
import botocore
|
||||||
|
HAS_BOTO3 = True
|
||||||
|
except:
|
||||||
|
HAS_BOTO3 = False
|
||||||
|
|
||||||
|
from nose.plugins.skip import SkipTest
|
||||||
|
|
||||||
|
from ansible.compat.tests import unittest
|
||||||
from ansible.module_utils.ec2 import AWSRetry
|
from ansible.module_utils.ec2 import AWSRetry
|
||||||
|
|
||||||
|
if not HAS_BOTO3:
|
||||||
|
raise SkipTest("test_aws.py requires the python modules 'boto3' and 'botocore'")
|
||||||
|
|
||||||
|
|
||||||
class RetryTestCase(unittest.TestCase):
|
class RetryTestCase(unittest.TestCase):
|
||||||
|
|
||||||
def test_no_failures(self):
|
def test_no_failures(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue