Remove unnecessary test imports. (#576)
parent
65d1881f12
commit
b08f6eefe8
|
@ -29,7 +29,7 @@ import traceback
|
||||||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import ipaddress
|
import ipaddress # noqa: F401, pylint: disable=unused-import
|
||||||
HAS_IPADDRESS = True
|
HAS_IPADDRESS = True
|
||||||
IPADDRESS_IMP_ERR = None
|
IPADDRESS_IMP_ERR = None
|
||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
|
|
|
@ -29,7 +29,7 @@ import traceback
|
||||||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import yaml
|
import yaml # noqa: F401, pylint: disable=unused-import
|
||||||
HAS_PYYAML = True
|
HAS_PYYAML = True
|
||||||
PYYAML_IMP_ERR = None
|
PYYAML_IMP_ERR = None
|
||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
|
|
|
@ -13,7 +13,7 @@ __metaclass__ = type
|
||||||
# One unittest needs to import builtins via __import__() so we need to have
|
# One unittest needs to import builtins via __import__() so we need to have
|
||||||
# the string that represents it
|
# the string that represents it
|
||||||
try:
|
try:
|
||||||
import __builtin__
|
import __builtin__ # noqa: F401, pylint: disable=unused-import
|
||||||
except ImportError:
|
except ImportError:
|
||||||
BUILTINS = 'builtins'
|
BUILTINS = 'builtins'
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -9,7 +9,7 @@ __metaclass__ = type
|
||||||
'''
|
'''
|
||||||
Compat module for Python3.x's unittest.mock module
|
Compat module for Python3.x's unittest.mock module
|
||||||
'''
|
'''
|
||||||
import sys
|
import sys # noqa: F401, pylint: disable=unused-import
|
||||||
|
|
||||||
# Python 2.7
|
# Python 2.7
|
||||||
|
|
||||||
|
@ -20,11 +20,11 @@ try:
|
||||||
# Allow wildcard import because we really do want to import all of mock's
|
# Allow wildcard import because we really do want to import all of mock's
|
||||||
# symbols into this compat shim
|
# symbols into this compat shim
|
||||||
# pylint: disable=wildcard-import,unused-wildcard-import
|
# pylint: disable=wildcard-import,unused-wildcard-import
|
||||||
from unittest.mock import *
|
from unittest.mock import * # noqa: F401, pylint: disable=unused-import
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# Python 2
|
# Python 2
|
||||||
# pylint: disable=wildcard-import,unused-wildcard-import
|
# pylint: disable=wildcard-import,unused-wildcard-import
|
||||||
try:
|
try:
|
||||||
from mock import *
|
from mock import * # noqa: F401, pylint: disable=unused-import
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print('You need the mock library installed on python2.x to run tests')
|
print('You need the mock library installed on python2.x to run tests')
|
||||||
|
|
|
@ -18,8 +18,8 @@ import sys
|
||||||
if sys.version_info < (2, 7):
|
if sys.version_info < (2, 7):
|
||||||
try:
|
try:
|
||||||
# Need unittest2 on python2.6
|
# Need unittest2 on python2.6
|
||||||
from unittest2 import *
|
from unittest2 import * # noqa: F401, pylint: disable=unused-import
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print('You need unittest2 installed on python2.6.x to run tests')
|
print('You need unittest2 installed on python2.6.x to run tests')
|
||||||
else:
|
else:
|
||||||
from unittest import *
|
from unittest import * # noqa: F401, pylint: disable=unused-import
|
||||||
|
|
|
@ -17,7 +17,6 @@ from ansible_collections.community.crypto.plugins.module_utils.acme.orders impor
|
||||||
|
|
||||||
from ansible_collections.community.crypto.plugins.module_utils.acme.errors import (
|
from ansible_collections.community.crypto.plugins.module_utils.acme.errors import (
|
||||||
ACMEProtocolException,
|
ACMEProtocolException,
|
||||||
ModuleFailException,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
|
||||||
|
|
||||||
import cryptography
|
import cryptography
|
||||||
import pytest
|
import pytest
|
||||||
|
|
|
@ -16,7 +16,6 @@ from socket import gethostname
|
||||||
from tempfile import mkdtemp
|
from tempfile import mkdtemp
|
||||||
|
|
||||||
from ansible_collections.community.crypto.plugins.module_utils.openssh.cryptography import (
|
from ansible_collections.community.crypto.plugins.module_utils.openssh.cryptography import (
|
||||||
AsymmetricKeypair,
|
|
||||||
HAS_OPENSSH_SUPPORT,
|
HAS_OPENSSH_SUPPORT,
|
||||||
InvalidCommentError,
|
InvalidCommentError,
|
||||||
InvalidPrivateKeyFileError,
|
InvalidPrivateKeyFileError,
|
||||||
|
|
|
@ -7,8 +7,6 @@ __metaclass__ = type
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from ansible_collections.community.crypto.plugins.modules import luks_device
|
from ansible_collections.community.crypto.plugins.modules import luks_device
|
||||||
from ansible_collections.community.crypto.tests.unit.compat.mock import patch
|
|
||||||
from ansible.module_utils import basic
|
|
||||||
|
|
||||||
|
|
||||||
class DummyModule(object):
|
class DummyModule(object):
|
||||||
|
|
Loading…
Reference in New Issue