mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 04:11:25 -07:00
[cloud][test] Use pytest conditional imports instead of nose/SkipTest (#22019)
This commit is contained in:
parent
7b2c013e5a
commit
fc0ae5ee6b
4 changed files with 13 additions and 38 deletions
|
@ -19,15 +19,14 @@
|
|||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
|
||||
from nose.plugins.skip import SkipTest
|
||||
import pytest
|
||||
boto3 = pytest.importorskip("boto3")
|
||||
|
||||
import json
|
||||
import copy
|
||||
from ansible.module_utils._text import to_bytes
|
||||
from ansible.module_utils import basic
|
||||
from ansible.compat.tests.mock import MagicMock, Mock, patch
|
||||
from ansible.module_utils.ec2 import HAS_BOTO3
|
||||
if not HAS_BOTO3:
|
||||
raise SkipTest("test_ec2_asg.py requires the `boto3`, and `botocore` modules")
|
||||
|
||||
# lambda is a keyword so we have to hack this.
|
||||
_temp = __import__("ansible.modules.cloud.amazon.lambda")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue