diff --git a/tests/integration/targets/module_helper/library/mdepfail.py b/tests/integration/targets/module_helper/library/mdepfail.py index d48727980a..92ebbde6e8 100644 --- a/tests/integration/targets/module_helper/library/mdepfail.py +++ b/tests/integration/targets/module_helper/library/mdepfail.py @@ -34,7 +34,7 @@ from ansible_collections.community.general.plugins.module_utils.module_helper im from ansible.module_utils.basic import missing_required_lib with ModuleHelper.dependency("nopackagewiththisname", missing_required_lib("nopackagewiththisname")): - import nopackagewiththisname + import nopackagewiththisname # noqa: F401, pylint: disable=unused-import class MSimple(ModuleHelper): diff --git a/tests/integration/targets/module_helper/library/msimpleda.py b/tests/integration/targets/module_helper/library/msimpleda.py index 74ec4ba010..c21c3d2ea4 100644 --- a/tests/integration/targets/module_helper/library/msimpleda.py +++ b/tests/integration/targets/module_helper/library/msimpleda.py @@ -6,7 +6,6 @@ # SPDX-License-Identifier: GPL-3.0-or-later from __future__ import absolute_import, division, print_function -import collections __metaclass__ = type DOCUMENTATION = ''' @@ -26,7 +25,9 @@ EXAMPLES = "" RETURN = "" from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper -from ansible_collections.community.general.plugins.module_utils.mh.mixins.deprecate_attrs import DeprecateAttrsMixin +from ansible_collections.community.general.plugins.module_utils.mh.mixins.deprecate_attrs import ( # noqa: F401, pylint: disable=unused-import + DeprecateAttrsMixin +) class MSimpleDA(ModuleHelper): diff --git a/tests/sanity/extra/aliases.py b/tests/sanity/extra/aliases.py index 8779fec513..c1dcba0df5 100755 --- a/tests/sanity/extra/aliases.py +++ b/tests/sanity/extra/aliases.py @@ -6,7 +6,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -import os import sys import yaml diff --git a/tests/sanity/extra/botmeta.py b/tests/sanity/extra/botmeta.py index c6d677ae5e..3b6c348344 100755 --- a/tests/sanity/extra/botmeta.py +++ b/tests/sanity/extra/botmeta.py @@ -13,8 +13,7 @@ import sys import yaml -from voluptuous import All, Any, MultipleInvalid, PREVENT_EXTRA -from voluptuous import Required, Schema, Invalid +from voluptuous import Any, MultipleInvalid, PREVENT_EXTRA, Schema from voluptuous.humanize import humanize_error diff --git a/tests/unit/compat/builtins.py b/tests/unit/compat/builtins.py index b0cc618676..d548601d46 100644 --- a/tests/unit/compat/builtins.py +++ b/tests/unit/compat/builtins.py @@ -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: diff --git a/tests/unit/compat/mock.py b/tests/unit/compat/mock.py index f8f565dcf3..bdbea945e6 100644 --- a/tests/unit/compat/mock.py +++ b/tests/unit/compat/mock.py @@ -20,12 +20,12 @@ 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') diff --git a/tests/unit/compat/unittest.py b/tests/unit/compat/unittest.py index 1872e58337..d50bab86f0 100644 --- a/tests/unit/compat/unittest.py +++ b/tests/unit/compat/unittest.py @@ -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 diff --git a/tests/unit/plugins/become/helper.py b/tests/unit/plugins/become/helper.py index 410738504b..9949e1befb 100644 --- a/tests/unit/plugins/become/helper.py +++ b/tests/unit/plugins/become/helper.py @@ -8,7 +8,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible.errors import AnsibleError from ansible.plugins.loader import become_loader, get_shell_plugin diff --git a/tests/unit/plugins/cache/test_redis.py b/tests/unit/plugins/cache/test_redis.py index 26f97c127e..81ae9293e3 100644 --- a/tests/unit/plugins/cache/test_redis.py +++ b/tests/unit/plugins/cache/test_redis.py @@ -10,7 +10,6 @@ import pytest pytest.importorskip('redis') -from ansible import constants as C from ansible.plugins.loader import cache_loader from ansible_collections.community.general.plugins.cache.redis import CacheModule as RedisCache diff --git a/tests/unit/plugins/callback/test_loganalytics.py b/tests/unit/plugins/callback/test_loganalytics.py index a61ad32d3a..f9fef3c5d6 100644 --- a/tests/unit/plugins/callback/test_loganalytics.py +++ b/tests/unit/plugins/callback/test_loganalytics.py @@ -7,7 +7,7 @@ __metaclass__ = type from ansible.executor.task_result import TaskResult from ansible_collections.community.general.tests.unit.compat import unittest -from ansible_collections.community.general.tests.unit.compat.mock import patch, call, MagicMock, Mock +from ansible_collections.community.general.tests.unit.compat.mock import patch, Mock from ansible_collections.community.general.plugins.callback.loganalytics import AzureLogAnalyticsSource from datetime import datetime diff --git a/tests/unit/plugins/callback/test_opentelemetry.py b/tests/unit/plugins/callback/test_opentelemetry.py index c6532bc2e5..dea2e29d41 100644 --- a/tests/unit/plugins/callback/test_opentelemetry.py +++ b/tests/unit/plugins/callback/test_opentelemetry.py @@ -10,7 +10,7 @@ from ansible.playbook.task import Task from ansible.executor.task_result import TaskResult from ansible_collections.community.general.tests.unit.compat import unittest from ansible_collections.community.general.tests.unit.compat.mock import patch, MagicMock, Mock -from ansible_collections.community.general.plugins.callback.opentelemetry import OpenTelemetrySource, TaskData, CallbackModule +from ansible_collections.community.general.plugins.callback.opentelemetry import OpenTelemetrySource, TaskData from collections import OrderedDict import sys diff --git a/tests/unit/plugins/callback/test_splunk.py b/tests/unit/plugins/callback/test_splunk.py index 595d1530b6..ddcdae24c7 100644 --- a/tests/unit/plugins/callback/test_splunk.py +++ b/tests/unit/plugins/callback/test_splunk.py @@ -7,7 +7,7 @@ __metaclass__ = type from ansible.executor.task_result import TaskResult from ansible_collections.community.general.tests.unit.compat import unittest -from ansible_collections.community.general.tests.unit.compat.mock import patch, call, MagicMock, Mock +from ansible_collections.community.general.tests.unit.compat.mock import patch, Mock from ansible_collections.community.general.plugins.callback.splunk import SplunkHTTPCollectorSource from datetime import datetime diff --git a/tests/unit/plugins/connection/test_lxc.py b/tests/unit/plugins/connection/test_lxc.py index 4a1139d6e9..8733a92e09 100644 --- a/tests/unit/plugins/connection/test_lxc.py +++ b/tests/unit/plugins/connection/test_lxc.py @@ -7,7 +7,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from io import StringIO -import pytest from ansible_collections.community.general.tests.unit.compat import unittest from ansible_collections.community.general.plugins.connection import lxc diff --git a/tests/unit/plugins/filter/test_crc32.py b/tests/unit/plugins/filter/test_crc32.py index 961840235d..8201045136 100644 --- a/tests/unit/plugins/filter/test_crc32.py +++ b/tests/unit/plugins/filter/test_crc32.py @@ -7,7 +7,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible_collections.community.general.tests.unit.compat import unittest -from ansible.errors import AnsibleError from ansible_collections.community.general.plugins.filter.crc32 import crc32s diff --git a/tests/unit/plugins/inventory/test_cobbler.py b/tests/unit/plugins/inventory/test_cobbler.py index 6db9b91cbc..a09001ad62 100644 --- a/tests/unit/plugins/inventory/test_cobbler.py +++ b/tests/unit/plugins/inventory/test_cobbler.py @@ -7,9 +7,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type import pytest -import sys -from ansible.errors import AnsibleError, AnsibleParserError from ansible_collections.community.general.plugins.inventory.cobbler import InventoryModule diff --git a/tests/unit/plugins/inventory/test_linode.py b/tests/unit/plugins/inventory/test_linode.py index 60b3c8cb68..e5b38d3b8b 100644 --- a/tests/unit/plugins/inventory/test_linode.py +++ b/tests/unit/plugins/inventory/test_linode.py @@ -16,7 +16,7 @@ mandatory_py_version = pytest.mark.skipif( ) -from ansible.errors import AnsibleError, AnsibleParserError +from ansible.errors import AnsibleError from ansible.parsing.dataloader import DataLoader from ansible_collections.community.general.plugins.inventory.linode import InventoryModule diff --git a/tests/unit/plugins/inventory/test_lxd.py b/tests/unit/plugins/inventory/test_lxd.py index 99c9e166c1..a1f31fdc58 100644 --- a/tests/unit/plugins/inventory/test_lxd.py +++ b/tests/unit/plugins/inventory/test_lxd.py @@ -8,9 +8,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type import pytest -import os -from ansible.errors import AnsibleError from ansible.inventory.data import InventoryData from ansible_collections.community.general.plugins.inventory.lxd import InventoryModule diff --git a/tests/unit/plugins/inventory/test_xen_orchestra.py b/tests/unit/plugins/inventory/test_xen_orchestra.py index 7d51f6f183..bae038e807 100644 --- a/tests/unit/plugins/inventory/test_xen_orchestra.py +++ b/tests/unit/plugins/inventory/test_xen_orchestra.py @@ -10,7 +10,6 @@ __metaclass__ = type import pytest -from ansible.errors import AnsibleError, AnsibleParserError from ansible.inventory.data import InventoryData from ansible_collections.community.general.plugins.inventory.xen_orchestra import InventoryModule diff --git a/tests/unit/plugins/lookup/test_bitwarden.py b/tests/unit/plugins/lookup/test_bitwarden.py index 90f3ff7751..2ab383c9c2 100644 --- a/tests/unit/plugins/lookup/test_bitwarden.py +++ b/tests/unit/plugins/lookup/test_bitwarden.py @@ -6,15 +6,13 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from argparse import ArgumentParser - from ansible_collections.community.general.tests.unit.compat import unittest from ansible_collections.community.general.tests.unit.compat.mock import patch from ansible.errors import AnsibleError from ansible.module_utils import six from ansible.plugins.loader import lookup_loader -from ansible_collections.community.general.plugins.lookup.bitwarden import LookupModule, Bitwarden, BitwardenException +from ansible_collections.community.general.plugins.lookup.bitwarden import Bitwarden MOCK_RECORDS = [ diff --git a/tests/unit/plugins/lookup/test_etcd3.py b/tests/unit/plugins/lookup/test_etcd3.py index 798d537ed9..e9ac777ebe 100644 --- a/tests/unit/plugins/lookup/test_etcd3.py +++ b/tests/unit/plugins/lookup/test_etcd3.py @@ -8,10 +8,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -import pytest from ansible_collections.community.general.tests.unit.compat import unittest from ansible_collections.community.general.tests.unit.compat.mock import patch, MagicMock -from ansible.errors import AnsibleError from ansible_collections.community.general.plugins.lookup import etcd3 from ansible.plugins.loader import lookup_loader diff --git a/tests/unit/plugins/lookup/test_lastpass.py b/tests/unit/plugins/lookup/test_lastpass.py index f9749716d7..5f65c9f633 100644 --- a/tests/unit/plugins/lookup/test_lastpass.py +++ b/tests/unit/plugins/lookup/test_lastpass.py @@ -14,7 +14,7 @@ from ansible_collections.community.general.tests.unit.compat.mock import patch from ansible.errors import AnsibleError from ansible.module_utils import six from ansible.plugins.loader import lookup_loader -from ansible_collections.community.general.plugins.lookup.lastpass import LookupModule, LPass, LPassException +from ansible_collections.community.general.plugins.lookup.lastpass import LPass, LPassException MOCK_ENTRIES = [{'username': 'user', diff --git a/tests/unit/plugins/module_utils/test_module_helper.py b/tests/unit/plugins/module_utils/test_module_helper.py index 18251cf2e9..3d8a4b654c 100644 --- a/tests/unit/plugins/module_utils/test_module_helper.py +++ b/tests/unit/plugins/module_utils/test_module_helper.py @@ -95,14 +95,14 @@ def test_arg_format_fail(fmt, style, stars, value, expected): def test_dependency_ctxmgr(): ctx = DependencyCtxMgr("POTATOES", "Potatoes must be installed") with ctx: - import potatoes_that_will_never_be_there + import potatoes_that_will_never_be_there # noqa: F401, pylint: disable=unused-import print("POTATOES: ctx.text={0}".format(ctx.text)) assert ctx.text == "Potatoes must be installed" assert not ctx.has_it ctx = DependencyCtxMgr("POTATOES2") with ctx: - import potatoes_that_will_never_be_there_again + import potatoes_that_will_never_be_there_again # noqa: F401, pylint: disable=unused-import assert not ctx.has_it print("POTATOES2: ctx.text={0}".format(ctx.text)) assert ctx.text.startswith("No module named") @@ -110,7 +110,7 @@ def test_dependency_ctxmgr(): ctx = DependencyCtxMgr("TYPING") with ctx: - import sys + import sys # noqa: F401, pylint: disable=unused-import assert ctx.has_it diff --git a/tests/unit/plugins/modules/cloud/linode/test_linode.py b/tests/unit/plugins/modules/cloud/linode/test_linode.py index 76aa5a75ce..b16dc32124 100644 --- a/tests/unit/plugins/modules/cloud/linode/test_linode.py +++ b/tests/unit/plugins/modules/cloud/linode/test_linode.py @@ -10,7 +10,7 @@ import pytest from ansible_collections.community.general.plugins.modules.cloud.linode import linode from ansible_collections.community.general.tests.unit.plugins.modules.utils import set_module_args -from .linode_conftest import api_key, auth +from .linode_conftest import api_key, auth # noqa: F401, pylint: disable=unused-import if not linode.HAS_LINODE: pytestmark = pytest.mark.skip('test_linode.py requires the `linode-python` module') diff --git a/tests/unit/plugins/modules/cloud/linode/test_linode_v4.py b/tests/unit/plugins/modules/cloud/linode/test_linode_v4.py index 1060633142..93f2df9fab 100644 --- a/tests/unit/plugins/modules/cloud/linode/test_linode_v4.py +++ b/tests/unit/plugins/modules/cloud/linode/test_linode_v4.py @@ -25,7 +25,7 @@ from ansible_collections.community.general.plugins.module_utils.linode import ge from ansible_collections.community.general.tests.unit.plugins.modules.utils import set_module_args from ansible_collections.community.general.tests.unit.compat import mock -from .linode_conftest import access_token, no_access_token_in_env, default_args, mock_linode +from .linode_conftest import access_token, no_access_token_in_env, default_args, mock_linode # noqa: F401, pylint: disable=unused-import def test_mandatory_state_is_validated(capfd): diff --git a/tests/unit/plugins/modules/cloud/misc/test_proxmox_tasks_info.py b/tests/unit/plugins/modules/cloud/misc/test_proxmox_tasks_info.py index 9d1bd74e69..29fc4e2029 100644 --- a/tests/unit/plugins/modules/cloud/misc/test_proxmox_tasks_info.py +++ b/tests/unit/plugins/modules/cloud/misc/test_proxmox_tasks_info.py @@ -15,13 +15,8 @@ import json from ansible_collections.community.general.plugins.modules.cloud.misc import proxmox_tasks_info import ansible_collections.community.general.plugins.module_utils.proxmox as proxmox_utils -from ansible_collections.community.general.plugins.module_utils.proxmox import ProxmoxAnsible -from ansible_collections.community.general.tests.unit.compat.mock import MagicMock, patch -from ansible_collections.community.general.tests.unit.plugins.modules.utils import ( - AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args -) +from ansible_collections.community.general.tests.unit.compat.mock import patch from ansible_collections.community.general.tests.unit.plugins.modules.utils import set_module_args -from ansible_collections.community.general.plugins.module_utils import proxmox NODE = 'node01' TASK_UPID = 'UPID:iaclab-01-01:000029DD:1599528B:6108F068:srvreload:networking:root@pam:' diff --git a/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_info.py b/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_info.py index 922d34e092..81f40b569a 100644 --- a/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_info.py +++ b/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_info.py @@ -12,7 +12,7 @@ import json import pytest from .xenserver_common import fake_xenapi_ref -from .xenserver_conftest import XenAPI, xenserver_guest_info +from .xenserver_conftest import XenAPI, xenserver_guest_info # noqa: F401, pylint: disable=unused-import pytestmark = pytest.mark.usefixtures('patch_ansible_module') diff --git a/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_powerstate.py b/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_powerstate.py index ea137628ad..808485f946 100644 --- a/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_powerstate.py +++ b/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_powerstate.py @@ -11,7 +11,7 @@ import json import pytest from .xenserver_common import fake_xenapi_ref -from .xenserver_conftest import fake_ansible_module, XenAPI, xenserver_guest_powerstate +from .xenserver_conftest import fake_ansible_module, XenAPI, xenserver_guest_powerstate # noqa: F401, pylint: disable=unused-import testcase_set_powerstate = { diff --git a/tests/unit/plugins/modules/database/misc/test_redis_data_incr.py b/tests/unit/plugins/modules/database/misc/test_redis_data_incr.py index 496a00313e..259ff9357b 100644 --- a/tests/unit/plugins/modules/database/misc/test_redis_data_incr.py +++ b/tests/unit/plugins/modules/database/misc/test_redis_data_incr.py @@ -21,7 +21,7 @@ HAS_REDIS_USERNAME_OPTION = True if tuple(map(int, __version__.split('.'))) < (3, 4, 0): HAS_REDIS_USERNAME_OPTION = False if HAS_REDIS_USERNAME_OPTION: - from redis.exceptions import NoPermissionError, RedisError, ResponseError + from redis.exceptions import NoPermissionError def test_redis_data_incr_without_arguments(capfd): diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_authentication.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_authentication.py index 226a3bad7c..2152cb38bf 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_authentication.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_authentication.py @@ -10,8 +10,8 @@ __metaclass__ = type from contextlib import contextmanager from ansible_collections.community.general.tests.unit.compat import unittest -from ansible_collections.community.general.tests.unit.compat.mock import call, patch -from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args +from ansible_collections.community.general.tests.unit.compat.mock import patch +from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, ModuleTestCase, set_module_args from ansible_collections.community.general.plugins.modules.identity.keycloak import keycloak_authentication diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client.py index 1f9fa8bc67..fdb11be9f3 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client.py @@ -11,9 +11,8 @@ __metaclass__ = type from contextlib import contextmanager from ansible_collections.community.general.tests.unit.compat import unittest -from ansible_collections.community.general.tests.unit.compat.mock import call, patch -from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, \ - ModuleTestCase, set_module_args +from ansible_collections.community.general.tests.unit.compat.mock import patch +from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, ModuleTestCase, set_module_args from ansible_collections.community.general.plugins.modules.identity.keycloak import keycloak_client diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client_rolemapping.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client_rolemapping.py index 72fc7850d5..59e879781d 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client_rolemapping.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client_rolemapping.py @@ -10,8 +10,8 @@ __metaclass__ = type from contextlib import contextmanager from ansible_collections.community.general.tests.unit.compat import unittest -from ansible_collections.community.general.tests.unit.compat.mock import call, patch -from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args +from ansible_collections.community.general.tests.unit.compat.mock import patch +from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, ModuleTestCase, set_module_args from ansible_collections.community.general.plugins.modules.identity.keycloak import keycloak_client_rolemapping diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_clientscope.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_clientscope.py index 011d451b4d..8d2ec3167b 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_clientscope.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_clientscope.py @@ -11,9 +11,8 @@ __metaclass__ = type from contextlib import contextmanager from ansible_collections.community.general.tests.unit.compat import unittest -from ansible_collections.community.general.tests.unit.compat.mock import call, patch -from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, \ - ModuleTestCase, set_module_args +from ansible_collections.community.general.tests.unit.compat.mock import patch +from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, ModuleTestCase, set_module_args from ansible_collections.community.general.plugins.modules.identity.keycloak import keycloak_clientscope diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_identity_provider.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_identity_provider.py index 7bcc4b41a2..bf35f473cc 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_identity_provider.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_identity_provider.py @@ -10,8 +10,8 @@ __metaclass__ = type from contextlib import contextmanager from ansible_collections.community.general.tests.unit.compat import unittest -from ansible_collections.community.general.tests.unit.compat.mock import call, patch -from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args +from ansible_collections.community.general.tests.unit.compat.mock import patch +from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, ModuleTestCase, set_module_args from ansible_collections.community.general.plugins.modules.identity.keycloak import keycloak_identity_provider diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm.py index 4158f320ba..e6625b5d26 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm.py @@ -10,8 +10,8 @@ __metaclass__ = type from contextlib import contextmanager from ansible_collections.community.general.tests.unit.compat import unittest -from ansible_collections.community.general.tests.unit.compat.mock import call, patch -from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args +from ansible_collections.community.general.tests.unit.compat.mock import patch +from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, ModuleTestCase, set_module_args from ansible_collections.community.general.plugins.modules.identity.keycloak import keycloak_realm diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm_info.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm_info.py index 7ac381b974..6f0b60f2e1 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm_info.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm_info.py @@ -10,7 +10,7 @@ __metaclass__ = type from contextlib import contextmanager from ansible_collections.community.general.tests.unit.compat import unittest -from ansible_collections.community.general.tests.unit.compat.mock import call, patch +from ansible_collections.community.general.tests.unit.compat.mock import patch from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, ModuleTestCase, set_module_args from ansible_collections.community.general.plugins.modules.identity.keycloak import keycloak_realm_info diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_role.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_role.py index 4e27bfcae9..48f0803351 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_role.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_role.py @@ -10,8 +10,8 @@ __metaclass__ = type from contextlib import contextmanager from ansible_collections.community.general.tests.unit.compat import unittest -from ansible_collections.community.general.tests.unit.compat.mock import call, patch -from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args +from ansible_collections.community.general.tests.unit.compat.mock import patch +from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, ModuleTestCase, set_module_args from ansible_collections.community.general.plugins.modules.identity.keycloak import keycloak_role diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_user_federation.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_user_federation.py index 88b61ac559..874b77ed8d 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_user_federation.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_user_federation.py @@ -10,8 +10,8 @@ __metaclass__ = type from contextlib import contextmanager from ansible_collections.community.general.tests.unit.compat import unittest -from ansible_collections.community.general.tests.unit.compat.mock import call, patch -from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args +from ansible_collections.community.general.tests.unit.compat.mock import patch +from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, ModuleTestCase, set_module_args from ansible_collections.community.general.plugins.modules.identity.keycloak import keycloak_user_federation diff --git a/tests/unit/plugins/modules/monitoring/test_alerta_customer.py b/tests/unit/plugins/modules/monitoring/test_alerta_customer.py index 21f6804d8a..ef63ab4e72 100644 --- a/tests/unit/plugins/modules/monitoring/test_alerta_customer.py +++ b/tests/unit/plugins/modules/monitoring/test_alerta_customer.py @@ -7,7 +7,7 @@ __metaclass__ = type import json import pytest -from ansible_collections.community.general.tests.unit.compat.mock import Mock, patch +from ansible_collections.community.general.tests.unit.compat.mock import patch from ansible_collections.community.general.plugins.modules.monitoring import alerta_customer from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args diff --git a/tests/unit/plugins/modules/monitoring/test_statsd.py b/tests/unit/plugins/modules/monitoring/test_statsd.py index 05613e369b..cdd88dcaa8 100644 --- a/tests/unit/plugins/modules/monitoring/test_statsd.py +++ b/tests/unit/plugins/modules/monitoring/test_statsd.py @@ -5,8 +5,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -import pytest - from ansible_collections.community.general.plugins.modules.monitoring import statsd from ansible_collections.community.general.tests.unit.compat.mock import patch, MagicMock from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args diff --git a/tests/unit/plugins/modules/notification/test_discord.py b/tests/unit/plugins/modules/notification/test_discord.py index 20f9547d43..69de4fb374 100644 --- a/tests/unit/plugins/modules/notification/test_discord.py +++ b/tests/unit/plugins/modules/notification/test_discord.py @@ -7,7 +7,7 @@ __metaclass__ = type import json import pytest -from ansible_collections.community.general.tests.unit.compat.mock import Mock, patch +from ansible_collections.community.general.tests.unit.compat.mock import patch from ansible_collections.community.general.plugins.modules.notification import discord from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args diff --git a/tests/unit/plugins/modules/packaging/language/test_npm.py b/tests/unit/plugins/modules/packaging/language/test_npm.py index e9a8d486fa..6ec2fafb38 100644 --- a/tests/unit/plugins/modules/packaging/language/test_npm.py +++ b/tests/unit/plugins/modules/packaging/language/test_npm.py @@ -8,8 +8,7 @@ __metaclass__ = type from ansible_collections.community.general.tests.unit.compat.mock import call, patch from ansible_collections.community.general.plugins.modules.packaging.language import npm -from ansible_collections.community.general.tests.unit.plugins.modules.utils import ( - AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args) +from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, ModuleTestCase, set_module_args class NPMModuleTestCase(ModuleTestCase): diff --git a/tests/unit/plugins/modules/packaging/os/rhn_conftest.py b/tests/unit/plugins/modules/packaging/os/rhn_conftest.py index a8f890050e..acc0e2f221 100644 --- a/tests/unit/plugins/modules/packaging/os/rhn_conftest.py +++ b/tests/unit/plugins/modules/packaging/os/rhn_conftest.py @@ -5,7 +5,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible_collections.community.general.tests.unit.compat.mock import patch from ansible.module_utils.six.moves import xmlrpc_client import pytest diff --git a/tests/unit/plugins/modules/packaging/os/test_macports.py b/tests/unit/plugins/modules/packaging/os/test_macports.py index 189f9616fe..540ea01afb 100644 --- a/tests/unit/plugins/modules/packaging/os/test_macports.py +++ b/tests/unit/plugins/modules/packaging/os/test_macports.py @@ -5,7 +5,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible.module_utils import basic from ansible_collections.community.general.plugins.modules.packaging.os import macports import pytest diff --git a/tests/unit/plugins/modules/packaging/os/test_pacman.py b/tests/unit/plugins/modules/packaging/os/test_pacman.py index 6826ee81e2..659afb5f15 100644 --- a/tests/unit/plugins/modules/packaging/os/test_pacman.py +++ b/tests/unit/plugins/modules/packaging/os/test_pacman.py @@ -6,12 +6,9 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -import sys - from ansible.module_utils import basic -from ansible_collections.community.general.tests.unit.compat import mock, unittest -from ansible_collections.community.general.tests.unit.compat.mock import patch +from ansible_collections.community.general.tests.unit.compat import mock from ansible_collections.community.general.tests.unit.plugins.modules.utils import ( AnsibleExitJson, AnsibleFailJson, @@ -27,7 +24,6 @@ from ansible_collections.community.general.plugins.modules.packaging.os.pacman i ) import pytest -import json def get_bin_path(self, arg, required=False): diff --git a/tests/unit/plugins/modules/packaging/os/test_rhn_channel.py b/tests/unit/plugins/modules/packaging/os/test_rhn_channel.py index c30a3488da..97418d1f22 100644 --- a/tests/unit/plugins/modules/packaging/os/test_rhn_channel.py +++ b/tests/unit/plugins/modules/packaging/os/test_rhn_channel.py @@ -10,7 +10,7 @@ import json from ansible_collections.community.general.plugins.modules.packaging.os import rhn_channel -from .rhn_conftest import mock_request +from .rhn_conftest import mock_request # noqa: F401, pylint: disable=unused-import import pytest diff --git a/tests/unit/plugins/modules/packaging/os/test_rhn_register.py b/tests/unit/plugins/modules/packaging/os/test_rhn_register.py index fa3b92d6d2..696e2e286e 100644 --- a/tests/unit/plugins/modules/packaging/os/test_rhn_register.py +++ b/tests/unit/plugins/modules/packaging/os/test_rhn_register.py @@ -15,7 +15,7 @@ import ansible.module_utils.six from ansible.module_utils.six.moves import xmlrpc_client from ansible_collections.community.general.plugins.modules.packaging.os import rhn_register -from .rhn_conftest import mock_request +from .rhn_conftest import mock_request # noqa: F401, pylint: disable=unused-import import pytest diff --git a/tests/unit/plugins/modules/remote_management/lenovoxcc/test_xcc_redfish_command.py b/tests/unit/plugins/modules/remote_management/lenovoxcc/test_xcc_redfish_command.py index 035d4c9852..5cc9841bff 100644 --- a/tests/unit/plugins/modules/remote_management/lenovoxcc/test_xcc_redfish_command.py +++ b/tests/unit/plugins/modules/remote_management/lenovoxcc/test_xcc_redfish_command.py @@ -5,12 +5,9 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -import json -from ansible_collections.community.general.tests.unit.compat import mock from ansible_collections.community.general.tests.unit.compat.mock import patch from ansible_collections.community.general.tests.unit.compat import unittest from ansible.module_utils import basic -from ansible.module_utils.common.text.converters import to_bytes import ansible_collections.community.general.plugins.modules.remote_management.lenovoxcc.xcc_redfish_command as module from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson from ansible_collections.community.general.tests.unit.plugins.modules.utils import set_module_args, exit_json, fail_json diff --git a/tests/unit/plugins/modules/remote_management/lxca/test_lxca_nodes.py b/tests/unit/plugins/modules/remote_management/lxca/test_lxca_nodes.py index 4e46547d82..c40d20b269 100644 --- a/tests/unit/plugins/modules/remote_management/lxca/test_lxca_nodes.py +++ b/tests/unit/plugins/modules/remote_management/lxca/test_lxca_nodes.py @@ -10,8 +10,6 @@ import json import pytest from ansible_collections.community.general.tests.unit.compat import mock from ansible_collections.community.general.plugins.modules.remote_management.lxca import lxca_nodes -from ansible_collections.community.general.plugins.module_utils.remote_management.lxca.common import setup_conn -from ansible_collections.community.general.plugins.module_utils.remote_management.lxca.common import close_conn @pytest.fixture(scope='module') diff --git a/tests/unit/plugins/modules/remote_management/oneview/hpe_test_utils.py b/tests/unit/plugins/modules/remote_management/oneview/hpe_test_utils.py index 658041772e..a41066c6b0 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/hpe_test_utils.py +++ b/tests/unit/plugins/modules/remote_management/oneview/hpe_test_utils.py @@ -13,7 +13,6 @@ import yaml from mock import Mock, patch from .oneview_module_loader import ONEVIEW_MODULE_UTILS_PATH -from .oneview_conftest import mock_ov_client, mock_ansible_module from hpOneView.oneview_client import OneViewClient diff --git a/tests/unit/plugins/modules/remote_management/oneview/oneview_module_loader.py b/tests/unit/plugins/modules/remote_management/oneview/oneview_module_loader.py index aa7d148f11..899fc72ec2 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/oneview_module_loader.py +++ b/tests/unit/plugins/modules/remote_management/oneview/oneview_module_loader.py @@ -15,18 +15,50 @@ if 'hpOneView' not in sys.modules: sys.modules['hpOneView.oneview_client'] = Mock() ONEVIEW_MODULE_UTILS_PATH = 'ansible_collections.community.general.plugins.module_utils.oneview' -from ansible_collections.community.general.plugins.module_utils.oneview import (OneViewModuleException, - OneViewModuleTaskError, - OneViewModuleResourceNotFound, - OneViewModuleBase) +from ansible_collections.community.general.plugins.module_utils.oneview import ( # noqa: F401, pylint: disable=unused-import + OneViewModuleException, + OneViewModuleTaskError, + OneViewModuleResourceNotFound, + OneViewModuleBase, +) -from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_ethernet_network import EthernetNetworkModule -from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_ethernet_network_info import EthernetNetworkInfoModule -from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_fc_network import FcNetworkModule -from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_fc_network_info import FcNetworkInfoModule -from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_fcoe_network import FcoeNetworkModule -from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_fcoe_network_info import FcoeNetworkInfoModule -from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_network_set import NetworkSetModule -from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_network_set_info import NetworkSetInfoModule -from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_san_manager import SanManagerModule -from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_san_manager_info import SanManagerInfoModule +from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_ethernet_network import ( \ + # noqa: F401, pylint: disable=unused-import + EthernetNetworkModule +) +from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_ethernet_network_info import ( \ + # noqa: F401, pylint: disable=unused-import + EthernetNetworkInfoModule +) +from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_fc_network import ( \ + # noqa: F401, pylint: disable=unused-import + FcNetworkModule +) +from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_fc_network_info import ( \ + # noqa: F401, pylint: disable=unused-import + FcNetworkInfoModule +) +from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_fcoe_network import ( \ + # noqa: F401, pylint: disable=unused-import + FcoeNetworkModule +) +from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_fcoe_network_info import ( \ + # noqa: F401, pylint: disable=unused-import + FcoeNetworkInfoModule +) +from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_network_set import ( \ + # noqa: F401, pylint: disable=unused-import + NetworkSetModule +) +from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_network_set_info import ( \ + # noqa: F401, pylint: disable=unused-import + NetworkSetInfoModule +) +from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_san_manager import ( \ + # noqa: F401, pylint: disable=unused-import + SanManagerModule +) +from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_san_manager_info import ( \ + # noqa: F401, pylint: disable=unused-import + SanManagerInfoModule +) diff --git a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_datacenter_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_datacenter_info.py index d2542d159c..b79b199eb7 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_datacenter_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_datacenter_info.py @@ -8,7 +8,7 @@ __metaclass__ = type import pytest from .hpe_test_utils import FactsParamsTest -from .oneview_conftest import mock_ov_client, mock_ansible_module +from .oneview_conftest import mock_ov_client, mock_ansible_module # noqa: F401, pylint: disable=unused-import from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_datacenter_info import DatacenterInfoModule diff --git a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_enclosure_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_enclosure_info.py index 1032d224a6..ca6adbfe29 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_enclosure_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_enclosure_info.py @@ -6,7 +6,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from .hpe_test_utils import FactsParamsTestCase -from .oneview_conftest import mock_ov_client, mock_ansible_module from ansible_collections.community.general.tests.unit.compat import unittest from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_enclosure_info import EnclosureInfoModule diff --git a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network.py index 834c6c88c6..f1398740ee 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network.py @@ -11,7 +11,6 @@ import yaml from ansible_collections.community.general.tests.unit.compat import unittest, mock from .oneview_module_loader import EthernetNetworkModule -from .oneview_conftest import mock_ov_client, mock_ansible_module from .hpe_test_utils import OneViewBaseTestCase FAKE_MSG_ERROR = 'Fake message error' diff --git a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network_info.py index f922bc8f48..4a2813e2f8 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network_info.py @@ -8,7 +8,6 @@ __metaclass__ = type from ansible_collections.community.general.tests.unit.compat import unittest from .oneview_module_loader import EthernetNetworkInfoModule -from .oneview_conftest import mock_ov_client, mock_ansible_module from .hpe_test_utils import FactsParamsTestCase ERROR_MSG = 'Fake message error' diff --git a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network.py index 97d5ef85b6..6def80fc43 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network.py @@ -9,7 +9,6 @@ __metaclass__ = type from ansible_collections.community.general.tests.unit.compat import unittest from .oneview_module_loader import FcNetworkModule -from .oneview_conftest import mock_ov_client, mock_ansible_module from .hpe_test_utils import OneViewBaseTestCase FAKE_MSG_ERROR = 'Fake message error' diff --git a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network_info.py index c548bf02f7..236ce136ad 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network_info.py @@ -7,7 +7,6 @@ __metaclass__ = type from ansible_collections.community.general.tests.unit.compat import unittest from .oneview_module_loader import FcNetworkInfoModule -from .oneview_conftest import mock_ov_client, mock_ansible_module from .hpe_test_utils import FactsParamsTestCase ERROR_MSG = 'Fake message error' diff --git a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network.py index 8e74f8c73d..224e5471e9 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network.py @@ -9,7 +9,6 @@ __metaclass__ = type from ansible_collections.community.general.tests.unit.compat import unittest from .oneview_module_loader import FcoeNetworkModule -from .oneview_conftest import mock_ov_client, mock_ansible_module from .hpe_test_utils import OneViewBaseTestCase FAKE_MSG_ERROR = 'Fake message error' diff --git a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network_info.py index a8fda975a8..387c1da3c1 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network_info.py @@ -8,7 +8,6 @@ __metaclass__ = type from ansible_collections.community.general.tests.unit.compat import unittest from .oneview_module_loader import FcoeNetworkInfoModule -from .oneview_conftest import mock_ov_client, mock_ansible_module from .hpe_test_utils import FactsParamsTestCase ERROR_MSG = 'Fake message error' diff --git a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group.py index 597c6953ef..3da493253d 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group.py @@ -9,7 +9,6 @@ from copy import deepcopy from ansible_collections.community.general.tests.unit.compat import unittest, mock from .hpe_test_utils import OneViewBaseTestCase -from .oneview_conftest import mock_ov_client, mock_ansible_module from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_logical_interconnect_group import LogicalInterconnectGroupModule diff --git a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group_info.py index 45f72a198b..eccb019ae3 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group_info.py @@ -7,7 +7,6 @@ __metaclass__ = type from ansible_collections.community.general.tests.unit.compat import unittest from .hpe_test_utils import FactsParamsTestCase -from .oneview_conftest import mock_ov_client, mock_ansible_module from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_logical_interconnect_group_info import ( LogicalInterconnectGroupInfoModule ) diff --git a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set.py index be89898aed..f801cd102a 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set.py @@ -8,7 +8,6 @@ __metaclass__ = type from ansible_collections.community.general.tests.unit.compat import unittest, mock from .hpe_test_utils import OneViewBaseTestCase from .oneview_module_loader import NetworkSetModule -from .oneview_conftest import mock_ov_client, mock_ansible_module FAKE_MSG_ERROR = 'Fake message error' diff --git a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set_info.py index 67d8f28201..13cd0400a4 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set_info.py @@ -7,7 +7,6 @@ __metaclass__ = type from ansible_collections.community.general.tests.unit.compat import unittest from .oneview_module_loader import NetworkSetInfoModule -from .oneview_conftest import mock_ov_client, mock_ansible_module from .hpe_test_utils import FactsParamsTestCase ERROR_MSG = 'Fake message error' diff --git a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager.py index 22ee624f24..d675c3b353 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager.py @@ -7,7 +7,6 @@ __metaclass__ = type from ansible_collections.community.general.tests.unit.compat import unittest, mock from .oneview_module_loader import SanManagerModule -from .oneview_conftest import mock_ov_client, mock_ansible_module from .hpe_test_utils import OneViewBaseTestCase from copy import deepcopy diff --git a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager_info.py index c786e504e0..be1f243161 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager_info.py @@ -7,7 +7,6 @@ __metaclass__ = type from ansible_collections.community.general.tests.unit.compat import unittest from .oneview_module_loader import SanManagerInfoModule -from .oneview_conftest import mock_ov_client, mock_ansible_module from .hpe_test_utils import FactsParamsTestCase diff --git a/tests/unit/plugins/modules/source_control/github/test_github_repo.py b/tests/unit/plugins/modules/source_control/github/test_github_repo.py index 2f494f7957..ad0195cd63 100644 --- a/tests/unit/plugins/modules/source_control/github/test_github_repo.py +++ b/tests/unit/plugins/modules/source_control/github/test_github_repo.py @@ -5,7 +5,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -import requests import re import json import sys diff --git a/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_protected_branch.py b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_protected_branch.py index 16222a8f33..3b87b2240e 100644 --- a/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_protected_branch.py +++ b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_protected_branch.py @@ -31,7 +31,7 @@ try: # GitLab module requirements if python_version_match_requirement(): - from gitlab.v4.objects import Project + from gitlab.v4.objects import Project # noqa: F401, pylint: disable=unused-import gitlab_req_version = python_gitlab_version_match_requirement() gitlab_module_version = python_gitlab_module_version() if LooseVersion(gitlab_module_version) < LooseVersion(gitlab_req_version):