diff --git a/tests/components/acmeda/test_config_flow.py b/tests/components/acmeda/test_config_flow.py index 1663bc3d443..98a23a0dd41 100644 --- a/tests/components/acmeda/test_config_flow.py +++ b/tests/components/acmeda/test_config_flow.py @@ -1,6 +1,5 @@ """Define tests for the Acmeda config flow.""" import aiopulse -from asynctest.mock import patch import pytest from homeassistant import data_entry_flow @@ -8,6 +7,7 @@ from homeassistant.components.acmeda.const import DOMAIN from homeassistant.config_entries import SOURCE_USER from homeassistant.const import CONF_HOST +from tests.async_mock import patch from tests.common import MockConfigEntry DUMMY_HOST1 = "127.0.0.1" diff --git a/tests/components/avri/test_config_flow.py b/tests/components/avri/test_config_flow.py index 291f7669ebd..c05935c62e4 100644 --- a/tests/components/avri/test_config_flow.py +++ b/tests/components/avri/test_config_flow.py @@ -1,9 +1,9 @@ """Test the Avri config flow.""" -from asynctest import patch - from homeassistant import config_entries, setup from homeassistant.components.avri.const import DOMAIN +from tests.async_mock import patch + async def test_form(hass): """Test we get the form.""" diff --git a/tests/components/awair/test_config_flow.py b/tests/components/awair/test_config_flow.py index bbd37bda075..c36780a1803 100644 --- a/tests/components/awair/test_config_flow.py +++ b/tests/components/awair/test_config_flow.py @@ -1,6 +1,5 @@ """Define tests for the Awair config flow.""" -from asynctest import patch from python_awair.exceptions import AuthError, AwairError from homeassistant import data_entry_flow @@ -10,6 +9,7 @@ from homeassistant.const import CONF_ACCESS_TOKEN from .const import CONFIG, DEVICES_FIXTURE, NO_DEVICES_FIXTURE, UNIQUE_ID, USER_FIXTURE +from tests.async_mock import patch from tests.common import MockConfigEntry diff --git a/tests/components/flick_electric/test_config_flow.py b/tests/components/flick_electric/test_config_flow.py index 94bff11135a..90a6271aa7d 100644 --- a/tests/components/flick_electric/test_config_flow.py +++ b/tests/components/flick_electric/test_config_flow.py @@ -1,13 +1,13 @@ """Test the Flick Electric config flow.""" import asyncio -from asynctest import patch from pyflick.authentication import AuthException from homeassistant import config_entries, data_entry_flow, setup from homeassistant.components.flick_electric.const import DOMAIN from homeassistant.const import CONF_PASSWORD, CONF_USERNAME +from tests.async_mock import patch from tests.common import MockConfigEntry CONF = {CONF_USERNAME: "test-username", CONF_PASSWORD: "test-password"} diff --git a/tests/components/guardian/conftest.py b/tests/components/guardian/conftest.py index f54b285b960..cfa9174ef57 100644 --- a/tests/components/guardian/conftest.py +++ b/tests/components/guardian/conftest.py @@ -1,7 +1,8 @@ """Define fixtures for Elexa Guardian tests.""" -from asynctest import patch import pytest +from tests.async_mock import patch + @pytest.fixture() def ping_client(): diff --git a/tests/components/guardian/test_config_flow.py b/tests/components/guardian/test_config_flow.py index 8e44b9f1417..91a1a3b83e0 100644 --- a/tests/components/guardian/test_config_flow.py +++ b/tests/components/guardian/test_config_flow.py @@ -1,6 +1,5 @@ """Define tests for the Elexa Guardian config flow.""" from aioguardian.errors import GuardianError -from asynctest import patch from homeassistant import data_entry_flow from homeassistant.components.guardian import CONF_UID, DOMAIN @@ -11,6 +10,7 @@ from homeassistant.components.guardian.config_flow import ( from homeassistant.config_entries import SOURCE_USER, SOURCE_ZEROCONF from homeassistant.const import CONF_IP_ADDRESS, CONF_PORT +from tests.async_mock import patch from tests.common import MockConfigEntry diff --git a/tests/components/homekit/test_config_flow.py b/tests/components/homekit/test_config_flow.py index 301e60fad67..fd3d546a507 100644 --- a/tests/components/homekit/test_config_flow.py +++ b/tests/components/homekit/test_config_flow.py @@ -1,11 +1,10 @@ """Test the HomeKit config flow.""" -from asynctest import patch - from homeassistant import config_entries, data_entry_flow, setup from homeassistant.components.homekit.const import DOMAIN from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const import CONF_NAME, CONF_PORT +from tests.async_mock import patch from tests.common import MockConfigEntry diff --git a/tests/components/homekit/test_homekit.py b/tests/components/homekit/test_homekit.py index b1f968eab10..3bc2c69c084 100644 --- a/tests/components/homekit/test_homekit.py +++ b/tests/components/homekit/test_homekit.py @@ -2,7 +2,6 @@ import os from typing import Dict -from asynctest import MagicMock import pytest from homeassistant.components import zeroconf @@ -62,7 +61,7 @@ from homeassistant.util import json as json_util from .util import PATH_HOMEKIT, async_init_entry, async_init_integration -from tests.async_mock import ANY, AsyncMock, Mock, patch +from tests.async_mock import ANY, AsyncMock, MagicMock, Mock, patch from tests.common import MockConfigEntry, mock_device_registry, mock_registry from tests.components.homekit.common import patch_debounce diff --git a/tests/components/homekit/util.py b/tests/components/homekit/util.py index 0abf3007c04..a9def6d02f7 100644 --- a/tests/components/homekit/util.py +++ b/tests/components/homekit/util.py @@ -1,11 +1,10 @@ """Test util for the homekit integration.""" -from asynctest import patch - from homeassistant.components.homekit.const import DOMAIN from homeassistant.const import CONF_NAME, CONF_PORT from homeassistant.core import HomeAssistant +from tests.async_mock import patch from tests.common import MockConfigEntry PATH_HOMEKIT = "homeassistant.components.homekit" diff --git a/tests/components/juicenet/test_config_flow.py b/tests/components/juicenet/test_config_flow.py index 12edeee50c5..4f00e9a1a76 100644 --- a/tests/components/juicenet/test_config_flow.py +++ b/tests/components/juicenet/test_config_flow.py @@ -1,13 +1,13 @@ """Test the JuiceNet config flow.""" import aiohttp -from asynctest import patch -from asynctest.mock import MagicMock from pyjuicenet import TokenError from homeassistant import config_entries, setup from homeassistant.components.juicenet.const import DOMAIN from homeassistant.const import CONF_ACCESS_TOKEN +from tests.async_mock import MagicMock, patch + def _mock_juicenet_return_value(get_devices=None): juicenet_mock = MagicMock() diff --git a/tests/components/panasonic_viera/test_init.py b/tests/components/panasonic_viera/test_init.py index 263f2def9af..327ab5829c1 100644 --- a/tests/components/panasonic_viera/test_init.py +++ b/tests/components/panasonic_viera/test_init.py @@ -1,6 +1,4 @@ """Test the Panasonic Viera setup process.""" -from asynctest import patch - from homeassistant.components.panasonic_viera.const import ( CONF_APP_ID, CONF_ENCRYPTION_KEY, @@ -13,7 +11,7 @@ from homeassistant.config_entries import ENTRY_STATE_NOT_LOADED from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT from homeassistant.setup import async_setup_component -from tests.async_mock import Mock +from tests.async_mock import Mock, patch from tests.common import MockConfigEntry MOCK_CONFIG_DATA = { diff --git a/tests/components/squeezebox/test_config_flow.py b/tests/components/squeezebox/test_config_flow.py index ec5a649fdc3..e38188e4a0f 100644 --- a/tests/components/squeezebox/test_config_flow.py +++ b/tests/components/squeezebox/test_config_flow.py @@ -1,5 +1,4 @@ """Test the Logitech Squeezebox config flow.""" -from asynctest import patch from pysqueezebox import Server from homeassistant import config_entries @@ -17,6 +16,7 @@ from homeassistant.data_entry_flow import ( RESULT_TYPE_FORM, ) +from tests.async_mock import patch from tests.common import MockConfigEntry HOST = "1.1.1.1" diff --git a/tests/components/upb/test_config_flow.py b/tests/components/upb/test_config_flow.py index 9aabcfbfbe7..c1440caedfd 100644 --- a/tests/components/upb/test_config_flow.py +++ b/tests/components/upb/test_config_flow.py @@ -1,10 +1,10 @@ """Test the UPB Control config flow.""" -from asynctest import MagicMock, PropertyMock, patch - from homeassistant import config_entries, setup from homeassistant.components.upb.const import DOMAIN +from tests.async_mock import MagicMock, PropertyMock, patch + def mocked_upb(sync_complete=True, config_ok=True): """Mock UPB lib.""" diff --git a/tests/components/wiffi/test_config_flow.py b/tests/components/wiffi/test_config_flow.py index 5c3e96eb959..87e119d2c6a 100644 --- a/tests/components/wiffi/test_config_flow.py +++ b/tests/components/wiffi/test_config_flow.py @@ -1,7 +1,6 @@ """Test the wiffi integration config flow.""" import errno -from asynctest import patch import pytest from homeassistant import config_entries, data_entry_flow @@ -13,6 +12,7 @@ from homeassistant.data_entry_flow import ( RESULT_TYPE_FORM, ) +from tests.async_mock import patch from tests.common import MockConfigEntry MOCK_CONFIG = {CONF_PORT: 8765} diff --git a/tests/components/withings/test_common.py b/tests/components/withings/test_common.py index 22f9e5ba0b6..1e9711a71a6 100644 --- a/tests/components/withings/test_common.py +++ b/tests/components/withings/test_common.py @@ -5,7 +5,6 @@ from typing import Any from urllib.parse import urlparse from aiohttp.test_utils import TestClient -from asynctest import MagicMock import pytest import requests_mock from withings_api.common import NotifyAppli, NotifyListProfile, NotifyListResponse @@ -18,6 +17,7 @@ from homeassistant.components.withings.common import ( from homeassistant.core import HomeAssistant from homeassistant.helpers.config_entry_oauth2_flow import AbstractOAuth2Implementation +from tests.async_mock import MagicMock from tests.common import MockConfigEntry from tests.components.withings.common import ( ComponentFactory, diff --git a/tests/components/zerproc/test_config_flow.py b/tests/components/zerproc/test_config_flow.py index 8dbead08adb..4e9c380910e 100644 --- a/tests/components/zerproc/test_config_flow.py +++ b/tests/components/zerproc/test_config_flow.py @@ -1,10 +1,11 @@ """Test the zerproc config flow.""" -from asynctest import patch import pyzerproc from homeassistant import config_entries, setup from homeassistant.components.zerproc.config_flow import DOMAIN +from tests.async_mock import patch + async def test_flow_success(hass): """Test we get the form.""" diff --git a/tests/components/zerproc/test_light.py b/tests/components/zerproc/test_light.py index 8f3716a34ea..6d2598ae5a6 100644 --- a/tests/components/zerproc/test_light.py +++ b/tests/components/zerproc/test_light.py @@ -1,5 +1,4 @@ """Test the zerproc lights.""" -from asynctest import patch import pytest import pyzerproc @@ -24,6 +23,7 @@ from homeassistant.const import ( ) import homeassistant.util.dt as dt_util +from tests.async_mock import patch from tests.common import MockConfigEntry, async_fire_time_changed