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