From 921430d4970d6cfab50ec2621a1b877bd1d5be2a Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Mon, 1 Jul 2024 12:09:11 +0200 Subject: [PATCH] Import Generator from collections.abc (3) (#120916) --- tests/components/gardena_bluetooth/conftest.py | 3 +-- tests/components/geo_json_events/conftest.py | 2 +- tests/components/geocaching/conftest.py | 2 +- tests/components/github/conftest.py | 2 +- tests/components/google/conftest.py | 3 +-- tests/components/google_sheets/test_config_flow.py | 2 +- tests/components/google_tasks/test_config_flow.py | 2 +- tests/components/google_translate/conftest.py | 2 +- tests/components/google_translate/test_tts.py | 2 +- tests/components/govee_light_local/conftest.py | 2 +- tests/components/gpsd/conftest.py | 2 +- tests/components/gree/conftest.py | 2 +- tests/components/greeneye_monitor/conftest.py | 2 +- tests/components/guardian/conftest.py | 2 +- tests/components/harmony/conftest.py | 2 +- tests/components/hassio/test_addon_manager.py | 2 +- tests/components/holiday/conftest.py | 2 +- tests/components/homeassistant_hardware/conftest.py | 2 +- .../homeassistant_hardware/test_silabs_multiprotocol_addon.py | 2 +- tests/components/homeassistant_sky_connect/conftest.py | 2 +- tests/components/homeassistant_yellow/conftest.py | 2 +- tests/components/homeassistant_yellow/test_config_flow.py | 2 +- tests/components/homekit_controller/conftest.py | 2 +- tests/components/homewizard/conftest.py | 2 +- tests/components/homeworks/conftest.py | 2 +- tests/components/hunterdouglas_powerview/conftest.py | 2 +- tests/components/husqvarna_automower/conftest.py | 2 +- tests/components/idasen_desk/conftest.py | 3 +-- tests/components/image/conftest.py | 3 ++- tests/components/imap/conftest.py | 2 +- tests/components/imgw_pib/conftest.py | 2 +- tests/components/incomfort/conftest.py | 2 +- tests/components/influxdb/test_init.py | 2 +- tests/components/influxdb/test_sensor.py | 2 +- tests/components/intellifire/conftest.py | 2 +- tests/components/ipma/test_config_flow.py | 2 +- tests/components/ipp/conftest.py | 2 +- tests/components/islamic_prayer_times/conftest.py | 2 +- tests/components/ista_ecotrend/conftest.py | 2 +- tests/components/jellyfin/conftest.py | 2 +- tests/components/jewish_calendar/conftest.py | 2 +- tests/components/jvc_projector/conftest.py | 2 +- tests/components/kaleidescape/conftest.py | 2 +- tests/components/kitchen_sink/test_notify.py | 2 +- tests/components/kmtronic/conftest.py | 2 +- tests/components/knocki/conftest.py | 2 +- tests/components/kostal_plenticore/conftest.py | 2 +- tests/components/kostal_plenticore/test_config_flow.py | 2 +- tests/components/kostal_plenticore/test_helper.py | 2 +- tests/components/kostal_plenticore/test_number.py | 2 +- tests/components/lacrosse_view/conftest.py | 2 +- tests/components/lamarzocco/conftest.py | 3 +-- tests/components/lametric/conftest.py | 2 +- tests/components/landisgyr_heat_meter/conftest.py | 2 +- tests/components/lawn_mower/test_init.py | 2 +- tests/components/lidarr/conftest.py | 3 +-- tests/components/linear_garage_door/conftest.py | 2 +- tests/components/local_calendar/conftest.py | 3 +-- tests/components/local_todo/conftest.py | 2 +- tests/components/lock/conftest.py | 2 +- tests/components/loqed/conftest.py | 2 +- tests/components/lovelace/test_cast.py | 2 +- tests/components/lovelace/test_dashboard.py | 2 +- tests/components/lovelace/test_init.py | 2 +- tests/components/lovelace/test_system_health.py | 2 +- tests/components/luftdaten/conftest.py | 2 +- tests/components/lutron/conftest.py | 2 +- tests/components/map/test_init.py | 2 +- tests/components/matrix/conftest.py | 2 +- tests/components/matter/conftest.py | 2 +- tests/components/matter/test_binary_sensor.py | 2 +- tests/components/matter/test_config_flow.py | 2 +- tests/components/matter/test_init.py | 2 +- tests/components/mealie/conftest.py | 2 +- tests/components/media_extractor/conftest.py | 2 +- tests/components/media_source/test_local_source.py | 2 +- tests/components/melnor/conftest.py | 2 +- tests/components/mjpeg/conftest.py | 2 +- tests/components/moon/conftest.py | 2 +- tests/components/motionblinds_ble/conftest.py | 2 +- tests/components/motionmount/conftest.py | 2 +- tests/components/mqtt/conftest.py | 2 +- tests/components/mqtt/test_config_flow.py | 3 +-- tests/components/mqtt/test_tag.py | 2 +- tests/components/mqtt_json/test_device_tracker.py | 2 +- tests/components/mysensors/conftest.py | 3 +-- tests/components/mystrom/conftest.py | 2 +- tests/components/myuplink/conftest.py | 2 +- tests/components/nest/common.py | 3 +-- tests/components/nest/conftest.py | 2 +- tests/components/nest/test_camera.py | 2 +- tests/components/nest/test_init.py | 2 +- tests/components/nest/test_media_source.py | 2 +- tests/components/network/conftest.py | 2 +- tests/components/nextbus/test_config_flow.py | 2 +- tests/components/nextbus/test_sensor.py | 2 +- tests/components/nextcloud/conftest.py | 2 +- tests/components/nibe_heatpump/conftest.py | 2 +- tests/components/notify/conftest.py | 3 ++- tests/components/notion/conftest.py | 2 +- tests/components/number/test_init.py | 2 +- tests/components/obihai/conftest.py | 2 +- tests/components/onboarding/test_views.py | 2 +- tests/components/ondilo_ico/conftest.py | 2 +- tests/components/onewire/conftest.py | 2 +- tests/components/onewire/test_binary_sensor.py | 2 +- tests/components/onewire/test_diagnostics.py | 2 +- tests/components/onewire/test_sensor.py | 2 +- tests/components/onewire/test_switch.py | 2 +- tests/components/open_meteo/conftest.py | 2 +- tests/components/openexchangerates/conftest.py | 2 +- tests/components/openexchangerates/test_config_flow.py | 2 +- tests/components/opengarage/conftest.py | 2 +- tests/components/opensky/conftest.py | 2 +- tests/components/openuv/conftest.py | 2 +- tests/components/opower/test_config_flow.py | 2 +- tests/components/oralb/conftest.py | 2 +- tests/components/ourgroceries/conftest.py | 2 +- tests/components/overkiz/conftest.py | 2 +- tests/components/permobil/conftest.py | 2 +- tests/components/philips_js/conftest.py | 2 +- tests/components/ping/test_device_tracker.py | 2 +- tests/components/plex/conftest.py | 2 +- tests/components/plugwise/conftest.py | 2 +- tests/components/poolsense/conftest.py | 2 +- tests/components/prosegur/test_alarm_control_panel.py | 2 +- tests/components/ps4/conftest.py | 2 +- tests/components/pure_energie/conftest.py | 2 +- tests/components/pvoutput/conftest.py | 2 +- 129 files changed, 131 insertions(+), 138 deletions(-) diff --git a/tests/components/gardena_bluetooth/conftest.py b/tests/components/gardena_bluetooth/conftest.py index 08f698b4b67..882c9b1b090 100644 --- a/tests/components/gardena_bluetooth/conftest.py +++ b/tests/components/gardena_bluetooth/conftest.py @@ -1,6 +1,6 @@ """Common fixtures for the Gardena Bluetooth tests.""" -from collections.abc import Callable, Coroutine +from collections.abc import Callable, Coroutine, Generator from typing import Any from unittest.mock import AsyncMock, Mock, patch @@ -10,7 +10,6 @@ from gardena_bluetooth.const import DeviceInformation from gardena_bluetooth.exceptions import CharacteristicNotFound from gardena_bluetooth.parse import Characteristic import pytest -from typing_extensions import Generator from homeassistant.components.gardena_bluetooth.const import DOMAIN from homeassistant.components.gardena_bluetooth.coordinator import SCAN_INTERVAL diff --git a/tests/components/geo_json_events/conftest.py b/tests/components/geo_json_events/conftest.py index beab7bf1403..11928e6f012 100644 --- a/tests/components/geo_json_events/conftest.py +++ b/tests/components/geo_json_events/conftest.py @@ -1,9 +1,9 @@ """Configuration for GeoJSON Events tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.geo_json_events import DOMAIN from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_RADIUS, CONF_URL diff --git a/tests/components/geocaching/conftest.py b/tests/components/geocaching/conftest.py index 155cd2c5a7e..28d87176e46 100644 --- a/tests/components/geocaching/conftest.py +++ b/tests/components/geocaching/conftest.py @@ -2,11 +2,11 @@ from __future__ import annotations +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch from geocachingapi import GeocachingStatus import pytest -from typing_extensions import Generator from homeassistant.components.geocaching.const import DOMAIN diff --git a/tests/components/github/conftest.py b/tests/components/github/conftest.py index df7de604c2c..ab262f3f522 100644 --- a/tests/components/github/conftest.py +++ b/tests/components/github/conftest.py @@ -1,9 +1,9 @@ """conftest for the GitHub integration.""" +from collections.abc import Generator from unittest.mock import patch import pytest -from typing_extensions import Generator from homeassistant.components.github.const import CONF_REPOSITORIES, DOMAIN from homeassistant.const import CONF_ACCESS_TOKEN diff --git a/tests/components/google/conftest.py b/tests/components/google/conftest.py index 26a32a64b21..0f9f2a9395d 100644 --- a/tests/components/google/conftest.py +++ b/tests/components/google/conftest.py @@ -2,7 +2,7 @@ from __future__ import annotations -from collections.abc import Awaitable, Callable +from collections.abc import AsyncGenerator, Awaitable, Callable, Generator import datetime import http import time @@ -13,7 +13,6 @@ from aiohttp.client_exceptions import ClientError from gcal_sync.auth import API_BASE_URL from oauth2client.client import OAuth2Credentials import pytest -from typing_extensions import AsyncGenerator, Generator import yaml from homeassistant.components.application_credentials import ( diff --git a/tests/components/google_sheets/test_config_flow.py b/tests/components/google_sheets/test_config_flow.py index 0da046645d2..a504d8c4280 100644 --- a/tests/components/google_sheets/test_config_flow.py +++ b/tests/components/google_sheets/test_config_flow.py @@ -1,10 +1,10 @@ """Test the Google Sheets config flow.""" +from collections.abc import Generator from unittest.mock import Mock, patch from gspread import GSpreadException import pytest -from typing_extensions import Generator from homeassistant import config_entries from homeassistant.components.application_credentials import ( diff --git a/tests/components/google_tasks/test_config_flow.py b/tests/components/google_tasks/test_config_flow.py index f2655afd602..f8ccc5e048f 100644 --- a/tests/components/google_tasks/test_config_flow.py +++ b/tests/components/google_tasks/test_config_flow.py @@ -1,11 +1,11 @@ """Test the Google Tasks config flow.""" +from collections.abc import Generator from unittest.mock import Mock, patch from googleapiclient.errors import HttpError from httplib2 import Response import pytest -from typing_extensions import Generator from homeassistant import config_entries from homeassistant.components.google_tasks.const import ( diff --git a/tests/components/google_translate/conftest.py b/tests/components/google_translate/conftest.py index 82f8d50b83c..aa84c201f0e 100644 --- a/tests/components/google_translate/conftest.py +++ b/tests/components/google_translate/conftest.py @@ -1,9 +1,9 @@ """Common fixtures for the Google Translate text-to-speech tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator @pytest.fixture diff --git a/tests/components/google_translate/test_tts.py b/tests/components/google_translate/test_tts.py index d19b1269438..4d14c7e28cb 100644 --- a/tests/components/google_translate/test_tts.py +++ b/tests/components/google_translate/test_tts.py @@ -2,6 +2,7 @@ from __future__ import annotations +from collections.abc import Generator from http import HTTPStatus from pathlib import Path from typing import Any @@ -9,7 +10,6 @@ from unittest.mock import MagicMock, patch from gtts import gTTSError import pytest -from typing_extensions import Generator from homeassistant.components import tts from homeassistant.components.google_translate.const import CONF_TLD, DOMAIN diff --git a/tests/components/govee_light_local/conftest.py b/tests/components/govee_light_local/conftest.py index 90a9f8e6827..6a8ee99b764 100644 --- a/tests/components/govee_light_local/conftest.py +++ b/tests/components/govee_light_local/conftest.py @@ -1,11 +1,11 @@ """Tests configuration for Govee Local API.""" from asyncio import Event +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch from govee_local_api import GoveeLightCapability import pytest -from typing_extensions import Generator from homeassistant.components.govee_light_local.coordinator import GoveeController diff --git a/tests/components/gpsd/conftest.py b/tests/components/gpsd/conftest.py index c323365e8fd..c15ef7f0258 100644 --- a/tests/components/gpsd/conftest.py +++ b/tests/components/gpsd/conftest.py @@ -1,9 +1,9 @@ """Common fixtures for the GPSD tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator @pytest.fixture diff --git a/tests/components/gree/conftest.py b/tests/components/gree/conftest.py index 88bcaea33c2..a9e2fc9e5d4 100644 --- a/tests/components/gree/conftest.py +++ b/tests/components/gree/conftest.py @@ -1,9 +1,9 @@ """Pytest module configuration.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator from .common import FakeDiscovery, build_device_mock diff --git a/tests/components/greeneye_monitor/conftest.py b/tests/components/greeneye_monitor/conftest.py index ad8a98ce3fe..343a15346e7 100644 --- a/tests/components/greeneye_monitor/conftest.py +++ b/tests/components/greeneye_monitor/conftest.py @@ -1,10 +1,10 @@ """Common fixtures for testing greeneye_monitor.""" +from collections.abc import Generator from typing import Any from unittest.mock import AsyncMock, MagicMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.greeneye_monitor import DOMAIN from homeassistant.components.sensor import SensorDeviceClass diff --git a/tests/components/guardian/conftest.py b/tests/components/guardian/conftest.py index 87ff96aff45..0063375f6ff 100644 --- a/tests/components/guardian/conftest.py +++ b/tests/components/guardian/conftest.py @@ -1,10 +1,10 @@ """Define fixtures for Elexa Guardian tests.""" +from collections.abc import Generator import json from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.guardian import CONF_UID, DOMAIN from homeassistant.const import CONF_IP_ADDRESS, CONF_PORT diff --git a/tests/components/harmony/conftest.py b/tests/components/harmony/conftest.py index fb4be73aa72..759770e9746 100644 --- a/tests/components/harmony/conftest.py +++ b/tests/components/harmony/conftest.py @@ -1,10 +1,10 @@ """Fixtures for harmony tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch from aioharmony.const import ClientCallbackType import pytest -from typing_extensions import Generator from homeassistant.components.harmony.const import ACTIVITY_POWER_OFF, DOMAIN from homeassistant.const import CONF_HOST, CONF_NAME diff --git a/tests/components/hassio/test_addon_manager.py b/tests/components/hassio/test_addon_manager.py index 55c663d66cc..6a20c6eec88 100644 --- a/tests/components/hassio/test_addon_manager.py +++ b/tests/components/hassio/test_addon_manager.py @@ -3,12 +3,12 @@ from __future__ import annotations import asyncio +from collections.abc import Generator import logging from typing import Any from unittest.mock import AsyncMock, call, patch import pytest -from typing_extensions import Generator from homeassistant.components.hassio.addon_manager import ( AddonError, diff --git a/tests/components/holiday/conftest.py b/tests/components/holiday/conftest.py index 1ac595aa1f9..005756695fe 100644 --- a/tests/components/holiday/conftest.py +++ b/tests/components/holiday/conftest.py @@ -1,9 +1,9 @@ """Common fixtures for the Holiday tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator @pytest.fixture diff --git a/tests/components/homeassistant_hardware/conftest.py b/tests/components/homeassistant_hardware/conftest.py index 72e937396ea..d3dcd443a07 100644 --- a/tests/components/homeassistant_hardware/conftest.py +++ b/tests/components/homeassistant_hardware/conftest.py @@ -1,10 +1,10 @@ """Test fixtures for the Home Assistant Hardware integration.""" +from collections.abc import Generator from typing import Any from unittest.mock import AsyncMock, MagicMock, patch import pytest -from typing_extensions import Generator @pytest.fixture(autouse=True) diff --git a/tests/components/homeassistant_hardware/test_silabs_multiprotocol_addon.py b/tests/components/homeassistant_hardware/test_silabs_multiprotocol_addon.py index 1df8fa86cf9..5718133cd24 100644 --- a/tests/components/homeassistant_hardware/test_silabs_multiprotocol_addon.py +++ b/tests/components/homeassistant_hardware/test_silabs_multiprotocol_addon.py @@ -2,11 +2,11 @@ from __future__ import annotations +from collections.abc import Generator from typing import Any from unittest.mock import AsyncMock, Mock, patch import pytest -from typing_extensions import Generator from homeassistant.components.hassio import AddonError, AddonInfo, AddonState, HassIO from homeassistant.components.hassio.handler import HassioAPIError diff --git a/tests/components/homeassistant_sky_connect/conftest.py b/tests/components/homeassistant_sky_connect/conftest.py index 099582999d5..69b0901aadf 100644 --- a/tests/components/homeassistant_sky_connect/conftest.py +++ b/tests/components/homeassistant_sky_connect/conftest.py @@ -1,9 +1,9 @@ """Test fixtures for the Home Assistant SkyConnect integration.""" +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch import pytest -from typing_extensions import Generator @pytest.fixture(name="mock_usb_serial_by_id", autouse=True) diff --git a/tests/components/homeassistant_yellow/conftest.py b/tests/components/homeassistant_yellow/conftest.py index 38398eb719f..2e6340bf54a 100644 --- a/tests/components/homeassistant_yellow/conftest.py +++ b/tests/components/homeassistant_yellow/conftest.py @@ -1,10 +1,10 @@ """Test fixtures for the Home Assistant Yellow integration.""" +from collections.abc import Generator from typing import Any from unittest.mock import AsyncMock, MagicMock, patch import pytest -from typing_extensions import Generator @pytest.fixture(autouse=True) diff --git a/tests/components/homeassistant_yellow/test_config_flow.py b/tests/components/homeassistant_yellow/test_config_flow.py index 4ae04180a64..95d7df89c9d 100644 --- a/tests/components/homeassistant_yellow/test_config_flow.py +++ b/tests/components/homeassistant_yellow/test_config_flow.py @@ -1,9 +1,9 @@ """Test the Home Assistant Yellow config flow.""" +from collections.abc import Generator from unittest.mock import Mock, patch import pytest -from typing_extensions import Generator from homeassistant.components.hassio import DOMAIN as HASSIO_DOMAIN from homeassistant.components.homeassistant_yellow.const import DOMAIN diff --git a/tests/components/homekit_controller/conftest.py b/tests/components/homekit_controller/conftest.py index 427c5285436..0c25e68f732 100644 --- a/tests/components/homekit_controller/conftest.py +++ b/tests/components/homekit_controller/conftest.py @@ -1,5 +1,6 @@ """HomeKit controller session fixtures.""" +from collections.abc import Generator import datetime from unittest.mock import MagicMock, patch @@ -7,7 +8,6 @@ from aiohomekit.testing import FakeController from freezegun import freeze_time from freezegun.api import FrozenDateTimeFactory import pytest -from typing_extensions import Generator import homeassistant.util.dt as dt_util diff --git a/tests/components/homewizard/conftest.py b/tests/components/homewizard/conftest.py index eb638492941..fcfe1e5c189 100644 --- a/tests/components/homewizard/conftest.py +++ b/tests/components/homewizard/conftest.py @@ -1,11 +1,11 @@ """Fixtures for HomeWizard integration tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch from homewizard_energy.errors import NotFoundError from homewizard_energy.models import Data, Device, State, System import pytest -from typing_extensions import Generator from homeassistant.components.homewizard.const import DOMAIN from homeassistant.const import CONF_IP_ADDRESS diff --git a/tests/components/homeworks/conftest.py b/tests/components/homeworks/conftest.py index ca0e08e9215..86c3381b7a0 100644 --- a/tests/components/homeworks/conftest.py +++ b/tests/components/homeworks/conftest.py @@ -1,9 +1,9 @@ """Common fixtures for the Lutron Homeworks Series 4 and 8 tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.homeworks.const import ( CONF_ADDR, diff --git a/tests/components/hunterdouglas_powerview/conftest.py b/tests/components/hunterdouglas_powerview/conftest.py index da339914aac..f7adeb111b8 100644 --- a/tests/components/hunterdouglas_powerview/conftest.py +++ b/tests/components/hunterdouglas_powerview/conftest.py @@ -1,10 +1,10 @@ """Common fixtures for Hunter Douglas Powerview tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch from aiopvapi.resources.shade import ShadePosition import pytest -from typing_extensions import Generator from homeassistant.components.hunterdouglas_powerview.const import DOMAIN diff --git a/tests/components/husqvarna_automower/conftest.py b/tests/components/husqvarna_automower/conftest.py index 7ace3b76808..dbb8f3b4c72 100644 --- a/tests/components/husqvarna_automower/conftest.py +++ b/tests/components/husqvarna_automower/conftest.py @@ -1,5 +1,6 @@ """Test helpers for Husqvarna Automower.""" +from collections.abc import Generator import time from unittest.mock import AsyncMock, patch @@ -7,7 +8,6 @@ from aioautomower.session import AutomowerSession, _MowerCommands from aioautomower.utils import mower_list_to_dictionary_dataclass from aiohttp import ClientWebSocketResponse import pytest -from typing_extensions import Generator from homeassistant.components.application_credentials import ( ClientCredential, diff --git a/tests/components/idasen_desk/conftest.py b/tests/components/idasen_desk/conftest.py index 91f3f2de40e..24ef8311445 100644 --- a/tests/components/idasen_desk/conftest.py +++ b/tests/components/idasen_desk/conftest.py @@ -1,11 +1,10 @@ """IKEA Idasen Desk fixtures.""" -from collections.abc import Callable +from collections.abc import Callable, Generator from unittest import mock from unittest.mock import AsyncMock, MagicMock import pytest -from typing_extensions import Generator @pytest.fixture(autouse=True) diff --git a/tests/components/image/conftest.py b/tests/components/image/conftest.py index 65bbf2e0c4f..8bb5d19b6db 100644 --- a/tests/components/image/conftest.py +++ b/tests/components/image/conftest.py @@ -1,7 +1,8 @@ """Test helpers for image.""" +from collections.abc import Generator + import pytest -from typing_extensions import Generator from homeassistant.components import image from homeassistant.config_entries import ConfigEntry, ConfigFlow diff --git a/tests/components/imap/conftest.py b/tests/components/imap/conftest.py index 354c9fbe24e..87663031e7a 100644 --- a/tests/components/imap/conftest.py +++ b/tests/components/imap/conftest.py @@ -1,10 +1,10 @@ """Fixtures for imap tests.""" +from collections.abc import AsyncGenerator, Generator from unittest.mock import AsyncMock, MagicMock, patch from aioimaplib import AUTH, LOGOUT, NONAUTH, SELECTED, STARTED, Response import pytest -from typing_extensions import AsyncGenerator, Generator from .const import EMPTY_SEARCH_RESPONSE, TEST_FETCH_RESPONSE_TEXT_PLAIN diff --git a/tests/components/imgw_pib/conftest.py b/tests/components/imgw_pib/conftest.py index 1d278856b5b..6f23ed3ee80 100644 --- a/tests/components/imgw_pib/conftest.py +++ b/tests/components/imgw_pib/conftest.py @@ -1,11 +1,11 @@ """Common fixtures for the IMGW-PIB tests.""" +from collections.abc import Generator from datetime import UTC, datetime from unittest.mock import AsyncMock, patch from imgw_pib import HydrologicalData, SensorData import pytest -from typing_extensions import Generator from homeassistant.components.imgw_pib.const import DOMAIN diff --git a/tests/components/incomfort/conftest.py b/tests/components/incomfort/conftest.py index 64885e38b65..122868605c8 100644 --- a/tests/components/incomfort/conftest.py +++ b/tests/components/incomfort/conftest.py @@ -1,11 +1,11 @@ """Fixtures for Intergas InComfort integration.""" +from collections.abc import Generator from typing import Any from unittest.mock import AsyncMock, MagicMock, patch from incomfortclient import DisplayCode import pytest -from typing_extensions import Generator from homeassistant.components.incomfort import DOMAIN from homeassistant.config_entries import ConfigEntry diff --git a/tests/components/influxdb/test_init.py b/tests/components/influxdb/test_init.py index 2d93322999d..d7e06b5c101 100644 --- a/tests/components/influxdb/test_init.py +++ b/tests/components/influxdb/test_init.py @@ -1,5 +1,6 @@ """The tests for the InfluxDB component.""" +from collections.abc import Generator from dataclasses import dataclass import datetime from http import HTTPStatus @@ -7,7 +8,6 @@ import logging from unittest.mock import ANY, MagicMock, Mock, call, patch import pytest -from typing_extensions import Generator from homeassistant.components import influxdb from homeassistant.components.influxdb.const import DEFAULT_BUCKET diff --git a/tests/components/influxdb/test_sensor.py b/tests/components/influxdb/test_sensor.py index 48cae2a3ae6..73dd8375a00 100644 --- a/tests/components/influxdb/test_sensor.py +++ b/tests/components/influxdb/test_sensor.py @@ -2,6 +2,7 @@ from __future__ import annotations +from collections.abc import Generator from dataclasses import dataclass from datetime import timedelta from http import HTTPStatus @@ -10,7 +11,6 @@ from unittest.mock import MagicMock, patch from influxdb.exceptions import InfluxDBClientError, InfluxDBServerError from influxdb_client.rest import ApiException import pytest -from typing_extensions import Generator from voluptuous import Invalid from homeassistant.components import sensor diff --git a/tests/components/intellifire/conftest.py b/tests/components/intellifire/conftest.py index 1aae4fb6dd6..cf1e085c10f 100644 --- a/tests/components/intellifire/conftest.py +++ b/tests/components/intellifire/conftest.py @@ -1,10 +1,10 @@ """Fixtures for IntelliFire integration tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, Mock, patch from aiohttp.client_reqrep import ConnectionKey import pytest -from typing_extensions import Generator @pytest.fixture diff --git a/tests/components/ipma/test_config_flow.py b/tests/components/ipma/test_config_flow.py index 38bb1dbf126..eba11b02ca0 100644 --- a/tests/components/ipma/test_config_flow.py +++ b/tests/components/ipma/test_config_flow.py @@ -1,10 +1,10 @@ """Tests for IPMA config flow.""" +from collections.abc import Generator from unittest.mock import patch from pyipma import IPMAException import pytest -from typing_extensions import Generator from homeassistant.components.ipma.const import DOMAIN from homeassistant.config_entries import SOURCE_USER diff --git a/tests/components/ipp/conftest.py b/tests/components/ipp/conftest.py index 5e39a16f3b1..9a47cc3c355 100644 --- a/tests/components/ipp/conftest.py +++ b/tests/components/ipp/conftest.py @@ -1,11 +1,11 @@ """Fixtures for IPP integration tests.""" +from collections.abc import Generator import json from unittest.mock import AsyncMock, MagicMock, patch from pyipp import Printer import pytest -from typing_extensions import Generator from homeassistant.components.ipp.const import CONF_BASE_PATH, DOMAIN from homeassistant.const import ( diff --git a/tests/components/islamic_prayer_times/conftest.py b/tests/components/islamic_prayer_times/conftest.py index ae9b1f45eb9..ae0b6741fdf 100644 --- a/tests/components/islamic_prayer_times/conftest.py +++ b/tests/components/islamic_prayer_times/conftest.py @@ -1,9 +1,9 @@ """Common fixtures for the islamic_prayer_times tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator @pytest.fixture diff --git a/tests/components/ista_ecotrend/conftest.py b/tests/components/ista_ecotrend/conftest.py index 2218ef05ba7..cbbc166031d 100644 --- a/tests/components/ista_ecotrend/conftest.py +++ b/tests/components/ista_ecotrend/conftest.py @@ -1,10 +1,10 @@ """Common fixtures for the ista EcoTrend tests.""" +from collections.abc import Generator from typing import Any from unittest.mock import AsyncMock, MagicMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.ista_ecotrend.const import DOMAIN from homeassistant.const import CONF_EMAIL, CONF_PASSWORD diff --git a/tests/components/jellyfin/conftest.py b/tests/components/jellyfin/conftest.py index 40d03212ceb..c3732714177 100644 --- a/tests/components/jellyfin/conftest.py +++ b/tests/components/jellyfin/conftest.py @@ -2,6 +2,7 @@ from __future__ import annotations +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, create_autospec, patch from jellyfin_apiclient_python import JellyfinClient @@ -9,7 +10,6 @@ from jellyfin_apiclient_python.api import API from jellyfin_apiclient_python.configuration import Config from jellyfin_apiclient_python.connection_manager import ConnectionManager import pytest -from typing_extensions import Generator from homeassistant.components.jellyfin.const import DOMAIN from homeassistant.const import CONF_PASSWORD, CONF_URL, CONF_USERNAME diff --git a/tests/components/jewish_calendar/conftest.py b/tests/components/jewish_calendar/conftest.py index 5e16289f473..97909291f27 100644 --- a/tests/components/jewish_calendar/conftest.py +++ b/tests/components/jewish_calendar/conftest.py @@ -1,9 +1,9 @@ """Common fixtures for the jewish_calendar tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.jewish_calendar.const import DEFAULT_NAME, DOMAIN diff --git a/tests/components/jvc_projector/conftest.py b/tests/components/jvc_projector/conftest.py index dd012d3f355..3115cbfe252 100644 --- a/tests/components/jvc_projector/conftest.py +++ b/tests/components/jvc_projector/conftest.py @@ -1,9 +1,9 @@ """Fixtures for JVC Projector integration.""" +from collections.abc import Generator from unittest.mock import MagicMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.jvc_projector.const import DOMAIN from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT diff --git a/tests/components/kaleidescape/conftest.py b/tests/components/kaleidescape/conftest.py index 5cd2a8ebb18..e5aeedc3895 100644 --- a/tests/components/kaleidescape/conftest.py +++ b/tests/components/kaleidescape/conftest.py @@ -1,11 +1,11 @@ """Fixtures for Kaleidescape integration.""" +from collections.abc import Generator from unittest.mock import MagicMock, patch from kaleidescape import Dispatcher from kaleidescape.device import Automation, Movie, Power, System import pytest -from typing_extensions import Generator from homeassistant.components.kaleidescape.const import DOMAIN from homeassistant.const import CONF_HOST diff --git a/tests/components/kitchen_sink/test_notify.py b/tests/components/kitchen_sink/test_notify.py index df025087b6b..12e19ffaa49 100644 --- a/tests/components/kitchen_sink/test_notify.py +++ b/tests/components/kitchen_sink/test_notify.py @@ -1,10 +1,10 @@ """The tests for the demo button component.""" +from collections.abc import AsyncGenerator from unittest.mock import patch from freezegun.api import FrozenDateTimeFactory import pytest -from typing_extensions import AsyncGenerator from homeassistant.components.kitchen_sink import DOMAIN from homeassistant.components.notify import ( diff --git a/tests/components/kmtronic/conftest.py b/tests/components/kmtronic/conftest.py index 5dc349508e3..11abd2a4d7b 100644 --- a/tests/components/kmtronic/conftest.py +++ b/tests/components/kmtronic/conftest.py @@ -1,9 +1,9 @@ """Define fixtures for kmtronic tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator @pytest.fixture diff --git a/tests/components/knocki/conftest.py b/tests/components/knocki/conftest.py index e1bc2e29cde..2fae89c730d 100644 --- a/tests/components/knocki/conftest.py +++ b/tests/components/knocki/conftest.py @@ -1,10 +1,10 @@ """Common fixtures for the Knocki tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch from knocki import TokenResponse, Trigger import pytest -from typing_extensions import Generator from homeassistant.components.knocki.const import DOMAIN from homeassistant.const import CONF_TOKEN diff --git a/tests/components/kostal_plenticore/conftest.py b/tests/components/kostal_plenticore/conftest.py index af958f19f3a..acce8ebed7a 100644 --- a/tests/components/kostal_plenticore/conftest.py +++ b/tests/components/kostal_plenticore/conftest.py @@ -2,11 +2,11 @@ from __future__ import annotations +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch from pykoplenti import MeData, VersionData import pytest -from typing_extensions import Generator from homeassistant.components.kostal_plenticore.coordinator import Plenticore from homeassistant.core import HomeAssistant diff --git a/tests/components/kostal_plenticore/test_config_flow.py b/tests/components/kostal_plenticore/test_config_flow.py index c982e2af818..bd9b9ad278d 100644 --- a/tests/components/kostal_plenticore/test_config_flow.py +++ b/tests/components/kostal_plenticore/test_config_flow.py @@ -1,10 +1,10 @@ """Test the Kostal Plenticore Solar Inverter config flow.""" +from collections.abc import Generator from unittest.mock import ANY, AsyncMock, MagicMock, patch from pykoplenti import ApiClient, AuthenticationException, SettingsData import pytest -from typing_extensions import Generator from homeassistant import config_entries from homeassistant.components.kostal_plenticore.const import DOMAIN diff --git a/tests/components/kostal_plenticore/test_helper.py b/tests/components/kostal_plenticore/test_helper.py index a18cf32c5a1..acd33f82a27 100644 --- a/tests/components/kostal_plenticore/test_helper.py +++ b/tests/components/kostal_plenticore/test_helper.py @@ -1,10 +1,10 @@ """Test Kostal Plenticore helper.""" +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch from pykoplenti import ApiClient, ExtendedApiClient, SettingsData import pytest -from typing_extensions import Generator from homeassistant.components.kostal_plenticore.const import DOMAIN from homeassistant.core import HomeAssistant diff --git a/tests/components/kostal_plenticore/test_number.py b/tests/components/kostal_plenticore/test_number.py index 9d94c6f9951..586129c486d 100644 --- a/tests/components/kostal_plenticore/test_number.py +++ b/tests/components/kostal_plenticore/test_number.py @@ -1,11 +1,11 @@ """Test Kostal Plenticore number.""" +from collections.abc import Generator from datetime import timedelta from unittest.mock import patch from pykoplenti import ApiClient, SettingsData import pytest -from typing_extensions import Generator from homeassistant.components.number import ( ATTR_MAX, diff --git a/tests/components/lacrosse_view/conftest.py b/tests/components/lacrosse_view/conftest.py index a6294c64210..4f1bfdc5748 100644 --- a/tests/components/lacrosse_view/conftest.py +++ b/tests/components/lacrosse_view/conftest.py @@ -1,9 +1,9 @@ """Define fixtures for LaCrosse View tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator @pytest.fixture diff --git a/tests/components/lamarzocco/conftest.py b/tests/components/lamarzocco/conftest.py index 6741ac0797c..e7a527a2b14 100644 --- a/tests/components/lamarzocco/conftest.py +++ b/tests/components/lamarzocco/conftest.py @@ -1,6 +1,6 @@ """Lamarzocco session fixtures.""" -from collections.abc import Callable +from collections.abc import Callable, Generator import json from unittest.mock import MagicMock, patch @@ -9,7 +9,6 @@ from lmcloud.const import FirmwareType, MachineModel, SteamLevel from lmcloud.lm_machine import LaMarzoccoMachine from lmcloud.models import LaMarzoccoDeviceInfo import pytest -from typing_extensions import Generator from homeassistant.components.lamarzocco.const import DOMAIN from homeassistant.const import CONF_HOST, CONF_MODEL, CONF_NAME, CONF_TOKEN diff --git a/tests/components/lametric/conftest.py b/tests/components/lametric/conftest.py index dd3885b78d9..e8ba727f3db 100644 --- a/tests/components/lametric/conftest.py +++ b/tests/components/lametric/conftest.py @@ -2,12 +2,12 @@ from __future__ import annotations +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch from demetriek import CloudDevice, Device from pydantic import parse_raw_as # pylint: disable=no-name-in-module import pytest -from typing_extensions import Generator from homeassistant.components.application_credentials import ( ClientCredential, diff --git a/tests/components/landisgyr_heat_meter/conftest.py b/tests/components/landisgyr_heat_meter/conftest.py index 22f29b3a4b1..1dad983c909 100644 --- a/tests/components/landisgyr_heat_meter/conftest.py +++ b/tests/components/landisgyr_heat_meter/conftest.py @@ -1,9 +1,9 @@ """Define fixtures for Landis + Gyr Heat Meter tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator @pytest.fixture diff --git a/tests/components/lawn_mower/test_init.py b/tests/components/lawn_mower/test_init.py index e7066ed43c1..16f32da7e04 100644 --- a/tests/components/lawn_mower/test_init.py +++ b/tests/components/lawn_mower/test_init.py @@ -1,9 +1,9 @@ """The tests for the lawn mower integration.""" +from collections.abc import Generator from unittest.mock import MagicMock import pytest -from typing_extensions import Generator from homeassistant.components.lawn_mower import ( DOMAIN as LAWN_MOWER_DOMAIN, diff --git a/tests/components/lidarr/conftest.py b/tests/components/lidarr/conftest.py index 588acb2b87f..1024aadc403 100644 --- a/tests/components/lidarr/conftest.py +++ b/tests/components/lidarr/conftest.py @@ -2,13 +2,12 @@ from __future__ import annotations -from collections.abc import Awaitable, Callable +from collections.abc import Awaitable, Callable, Generator from http import HTTPStatus from aiohttp.client_exceptions import ClientError from aiopyarr.lidarr_client import LidarrClient import pytest -from typing_extensions import Generator from homeassistant.components.lidarr.const import DOMAIN from homeassistant.const import ( diff --git a/tests/components/linear_garage_door/conftest.py b/tests/components/linear_garage_door/conftest.py index 306da23ebf9..4ed7662e5d0 100644 --- a/tests/components/linear_garage_door/conftest.py +++ b/tests/components/linear_garage_door/conftest.py @@ -1,9 +1,9 @@ """Common fixtures for the Linear Garage Door tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.linear_garage_door import DOMAIN from homeassistant.const import CONF_EMAIL, CONF_PASSWORD diff --git a/tests/components/local_calendar/conftest.py b/tests/components/local_calendar/conftest.py index 6d2c38544a5..8aef73a9d5a 100644 --- a/tests/components/local_calendar/conftest.py +++ b/tests/components/local_calendar/conftest.py @@ -1,6 +1,6 @@ """Fixtures for local calendar.""" -from collections.abc import Awaitable, Callable +from collections.abc import Awaitable, Callable, Generator from http import HTTPStatus from pathlib import Path from typing import Any @@ -9,7 +9,6 @@ import urllib from aiohttp import ClientWebSocketResponse import pytest -from typing_extensions import Generator from homeassistant.components.local_calendar import LocalCalendarStore from homeassistant.components.local_calendar.const import CONF_CALENDAR_NAME, DOMAIN diff --git a/tests/components/local_todo/conftest.py b/tests/components/local_todo/conftest.py index 67ef76172b7..ab73dabb474 100644 --- a/tests/components/local_todo/conftest.py +++ b/tests/components/local_todo/conftest.py @@ -1,11 +1,11 @@ """Common fixtures for the local_todo tests.""" +from collections.abc import Generator from pathlib import Path from typing import Any from unittest.mock import AsyncMock, Mock, patch import pytest -from typing_extensions import Generator from homeassistant.components.local_todo import LocalTodoListStore from homeassistant.components.local_todo.const import ( diff --git a/tests/components/lock/conftest.py b/tests/components/lock/conftest.py index f1715687339..fd569b162bc 100644 --- a/tests/components/lock/conftest.py +++ b/tests/components/lock/conftest.py @@ -1,10 +1,10 @@ """Fixtures for the lock entity platform tests.""" +from collections.abc import Generator from typing import Any from unittest.mock import MagicMock import pytest -from typing_extensions import Generator from homeassistant.components.lock import ( DOMAIN as LOCK_DOMAIN, diff --git a/tests/components/loqed/conftest.py b/tests/components/loqed/conftest.py index 57ef19d0fcb..ddad8949d7d 100644 --- a/tests/components/loqed/conftest.py +++ b/tests/components/loqed/conftest.py @@ -1,12 +1,12 @@ """Contains fixtures for Loqed tests.""" +from collections.abc import AsyncGenerator import json from typing import Any from unittest.mock import AsyncMock, Mock, patch from loqedAPI import loqed import pytest -from typing_extensions import AsyncGenerator from homeassistant.components.loqed import DOMAIN from homeassistant.components.loqed.const import CONF_CLOUDHOOK_URL diff --git a/tests/components/lovelace/test_cast.py b/tests/components/lovelace/test_cast.py index 632ea731d0c..3d6710d22d1 100644 --- a/tests/components/lovelace/test_cast.py +++ b/tests/components/lovelace/test_cast.py @@ -1,10 +1,10 @@ """Test the Lovelace Cast platform.""" +from collections.abc import Generator from time import time from unittest.mock import MagicMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.lovelace import cast as lovelace_cast from homeassistant.components.media_player import MediaClass diff --git a/tests/components/lovelace/test_dashboard.py b/tests/components/lovelace/test_dashboard.py index 7577c4dcc0d..3a01e20c1fb 100644 --- a/tests/components/lovelace/test_dashboard.py +++ b/tests/components/lovelace/test_dashboard.py @@ -1,11 +1,11 @@ """Test the Lovelace initialization.""" +from collections.abc import Generator import time from typing import Any from unittest.mock import MagicMock, patch import pytest -from typing_extensions import Generator from homeassistant.components import frontend from homeassistant.components.lovelace import const, dashboard diff --git a/tests/components/lovelace/test_init.py b/tests/components/lovelace/test_init.py index dc111ab601e..14d93d8302f 100644 --- a/tests/components/lovelace/test_init.py +++ b/tests/components/lovelace/test_init.py @@ -1,10 +1,10 @@ """Test the Lovelace initialization.""" +from collections.abc import Generator from typing import Any from unittest.mock import MagicMock, patch import pytest -from typing_extensions import Generator from homeassistant.core import HomeAssistant from homeassistant.setup import async_setup_component diff --git a/tests/components/lovelace/test_system_health.py b/tests/components/lovelace/test_system_health.py index d53ebf2871f..4fe248fa950 100644 --- a/tests/components/lovelace/test_system_health.py +++ b/tests/components/lovelace/test_system_health.py @@ -1,10 +1,10 @@ """Tests for Lovelace system health.""" +from collections.abc import Generator from typing import Any from unittest.mock import MagicMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.lovelace import dashboard from homeassistant.core import HomeAssistant diff --git a/tests/components/luftdaten/conftest.py b/tests/components/luftdaten/conftest.py index e1aac7caeb0..c3daa390e49 100644 --- a/tests/components/luftdaten/conftest.py +++ b/tests/components/luftdaten/conftest.py @@ -2,10 +2,10 @@ from __future__ import annotations +from collections.abc import Generator from unittest.mock import MagicMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.luftdaten.const import CONF_SENSOR_ID, DOMAIN from homeassistant.const import CONF_SHOW_ON_MAP diff --git a/tests/components/lutron/conftest.py b/tests/components/lutron/conftest.py index 90f96f1783d..f2106f736dc 100644 --- a/tests/components/lutron/conftest.py +++ b/tests/components/lutron/conftest.py @@ -1,9 +1,9 @@ """Provide common Lutron fixtures and mocks.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator @pytest.fixture diff --git a/tests/components/map/test_init.py b/tests/components/map/test_init.py index afafdd1eb16..217550852bd 100644 --- a/tests/components/map/test_init.py +++ b/tests/components/map/test_init.py @@ -1,10 +1,10 @@ """Test the Map initialization.""" +from collections.abc import Generator from typing import Any from unittest.mock import MagicMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.map import DOMAIN from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant diff --git a/tests/components/matrix/conftest.py b/tests/components/matrix/conftest.py index bb5448a8a09..11347302177 100644 --- a/tests/components/matrix/conftest.py +++ b/tests/components/matrix/conftest.py @@ -2,6 +2,7 @@ from __future__ import annotations +from collections.abc import Generator from pathlib import Path import re import tempfile @@ -24,7 +25,6 @@ from nio import ( ) from PIL import Image import pytest -from typing_extensions import Generator from homeassistant.components.matrix import ( CONF_COMMANDS, diff --git a/tests/components/matter/conftest.py b/tests/components/matter/conftest.py index 05fd776e57a..d561f6db1f9 100644 --- a/tests/components/matter/conftest.py +++ b/tests/components/matter/conftest.py @@ -3,13 +3,13 @@ from __future__ import annotations import asyncio +from collections.abc import AsyncGenerator, Generator from unittest.mock import AsyncMock, MagicMock, patch from matter_server.client.models.node import MatterNode from matter_server.common.const import SCHEMA_VERSION from matter_server.common.models import ServerInfoMessage import pytest -from typing_extensions import AsyncGenerator, Generator from homeassistant.core import HomeAssistant diff --git a/tests/components/matter/test_binary_sensor.py b/tests/components/matter/test_binary_sensor.py index becedc0af62..f419a12c59f 100644 --- a/tests/components/matter/test_binary_sensor.py +++ b/tests/components/matter/test_binary_sensor.py @@ -1,10 +1,10 @@ """Test Matter binary sensors.""" +from collections.abc import Generator from unittest.mock import MagicMock, patch from matter_server.client.models.node import MatterNode import pytest -from typing_extensions import Generator from homeassistant.components.matter.binary_sensor import ( DISCOVERY_SCHEMAS as BINARY_SENSOR_SCHEMAS, diff --git a/tests/components/matter/test_config_flow.py b/tests/components/matter/test_config_flow.py index 562cf4bb86a..642bfe0f804 100644 --- a/tests/components/matter/test_config_flow.py +++ b/tests/components/matter/test_config_flow.py @@ -2,13 +2,13 @@ from __future__ import annotations +from collections.abc import Generator from ipaddress import ip_address from typing import Any from unittest.mock import DEFAULT, AsyncMock, MagicMock, call, patch from matter_server.client.exceptions import CannotConnect, InvalidServerVersion import pytest -from typing_extensions import Generator from homeassistant import config_entries from homeassistant.components.hassio import HassioAPIError, HassioServiceInfo diff --git a/tests/components/matter/test_init.py b/tests/components/matter/test_init.py index c28385efca3..cd5ef307cd3 100644 --- a/tests/components/matter/test_init.py +++ b/tests/components/matter/test_init.py @@ -3,6 +3,7 @@ from __future__ import annotations import asyncio +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, call, patch from matter_server.client.exceptions import ( @@ -15,7 +16,6 @@ from matter_server.common.errors import MatterError from matter_server.common.helpers.util import dataclass_from_dict from matter_server.common.models import MatterNodeData import pytest -from typing_extensions import Generator from homeassistant.components.hassio import HassioAPIError from homeassistant.components.matter.const import DOMAIN diff --git a/tests/components/mealie/conftest.py b/tests/components/mealie/conftest.py index 9bda9e3c46d..ebcafcce5b5 100644 --- a/tests/components/mealie/conftest.py +++ b/tests/components/mealie/conftest.py @@ -1,11 +1,11 @@ """Mealie tests configuration.""" +from collections.abc import Generator from unittest.mock import patch from aiomealie import Mealplan, MealplanResponse, UserInfo from mashumaro.codecs.orjson import ORJSONDecoder import pytest -from typing_extensions import Generator from homeassistant.components.mealie.const import DOMAIN from homeassistant.const import CONF_API_TOKEN, CONF_HOST diff --git a/tests/components/media_extractor/conftest.py b/tests/components/media_extractor/conftest.py index 1d198681f3f..45b3bb698e0 100644 --- a/tests/components/media_extractor/conftest.py +++ b/tests/components/media_extractor/conftest.py @@ -1,10 +1,10 @@ """Common fixtures for the Media Extractor tests.""" +from collections.abc import Generator from typing import Any from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.media_extractor import DOMAIN from homeassistant.core import HomeAssistant, ServiceCall diff --git a/tests/components/media_source/test_local_source.py b/tests/components/media_source/test_local_source.py index 4c7fbd06edc..de90f229a85 100644 --- a/tests/components/media_source/test_local_source.py +++ b/tests/components/media_source/test_local_source.py @@ -1,5 +1,6 @@ """Test Local Media Source.""" +from collections.abc import AsyncGenerator from http import HTTPStatus import io from pathlib import Path @@ -7,7 +8,6 @@ from tempfile import TemporaryDirectory from unittest.mock import patch import pytest -from typing_extensions import AsyncGenerator from homeassistant.components import media_source, websocket_api from homeassistant.components.media_source import const diff --git a/tests/components/melnor/conftest.py b/tests/components/melnor/conftest.py index 38bc1a62d51..f30213c4efd 100644 --- a/tests/components/melnor/conftest.py +++ b/tests/components/melnor/conftest.py @@ -2,12 +2,12 @@ from __future__ import annotations +from collections.abc import Generator from datetime import UTC, datetime, time, timedelta from unittest.mock import AsyncMock, _patch, patch from melnor_bluetooth.device import Device import pytest -from typing_extensions import Generator from homeassistant.components.bluetooth.models import BluetoothServiceInfoBleak from homeassistant.components.melnor.const import DOMAIN diff --git a/tests/components/mjpeg/conftest.py b/tests/components/mjpeg/conftest.py index 00eaf946113..12e0b4c0faf 100644 --- a/tests/components/mjpeg/conftest.py +++ b/tests/components/mjpeg/conftest.py @@ -2,11 +2,11 @@ from __future__ import annotations +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest from requests_mock import Mocker -from typing_extensions import Generator from homeassistant.components.mjpeg.const import ( CONF_MJPEG_URL, diff --git a/tests/components/moon/conftest.py b/tests/components/moon/conftest.py index 6fa54fcb603..3cf0eb1afc3 100644 --- a/tests/components/moon/conftest.py +++ b/tests/components/moon/conftest.py @@ -2,10 +2,10 @@ from __future__ import annotations +from collections.abc import Generator from unittest.mock import patch import pytest -from typing_extensions import Generator from homeassistant.components.moon.const import DOMAIN diff --git a/tests/components/motionblinds_ble/conftest.py b/tests/components/motionblinds_ble/conftest.py index 342e958eae4..00db23734dd 100644 --- a/tests/components/motionblinds_ble/conftest.py +++ b/tests/components/motionblinds_ble/conftest.py @@ -1,9 +1,9 @@ """Setup the Motionblinds Bluetooth tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, Mock, patch import pytest -from typing_extensions import Generator TEST_MAC = "abcd" TEST_NAME = f"MOTION_{TEST_MAC.upper()}" diff --git a/tests/components/motionmount/conftest.py b/tests/components/motionmount/conftest.py index 9e5b0355387..49f624b5266 100644 --- a/tests/components/motionmount/conftest.py +++ b/tests/components/motionmount/conftest.py @@ -1,9 +1,9 @@ """Fixtures for Vogel's MotionMount integration tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.motionmount.const import DOMAIN from homeassistant.const import CONF_HOST, CONF_PORT diff --git a/tests/components/mqtt/conftest.py b/tests/components/mqtt/conftest.py index 774785bb42a..7395767aeae 100644 --- a/tests/components/mqtt/conftest.py +++ b/tests/components/mqtt/conftest.py @@ -1,12 +1,12 @@ """Test fixtures for mqtt component.""" import asyncio +from collections.abc import AsyncGenerator, Generator from random import getrandbits from typing import Any from unittest.mock import patch import pytest -from typing_extensions import AsyncGenerator, Generator from homeassistant.components import mqtt from homeassistant.components.mqtt.models import MessageCallbackType, ReceiveMessage diff --git a/tests/components/mqtt/test_config_flow.py b/tests/components/mqtt/test_config_flow.py index 457bd19c16f..38dfdefcf97 100644 --- a/tests/components/mqtt/test_config_flow.py +++ b/tests/components/mqtt/test_config_flow.py @@ -1,6 +1,6 @@ """Test config flow.""" -from collections.abc import Iterator +from collections.abc import Generator, Iterator from contextlib import contextmanager from pathlib import Path from ssl import SSLError @@ -9,7 +9,6 @@ from unittest.mock import AsyncMock, MagicMock, patch from uuid import uuid4 import pytest -from typing_extensions import Generator import voluptuous as vol from homeassistant import config_entries diff --git a/tests/components/mqtt/test_tag.py b/tests/components/mqtt/test_tag.py index 4cf0606deb8..adebd157588 100644 --- a/tests/components/mqtt/test_tag.py +++ b/tests/components/mqtt/test_tag.py @@ -1,11 +1,11 @@ """The tests for MQTT tag scanner.""" +from collections.abc import Generator import copy import json from unittest.mock import ANY, AsyncMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.device_automation import DeviceAutomationType from homeassistant.components.mqtt.const import DOMAIN as MQTT_DOMAIN diff --git a/tests/components/mqtt_json/test_device_tracker.py b/tests/components/mqtt_json/test_device_tracker.py index a992c985057..36073c11a5d 100644 --- a/tests/components/mqtt_json/test_device_tracker.py +++ b/tests/components/mqtt_json/test_device_tracker.py @@ -1,12 +1,12 @@ """The tests for the JSON MQTT device tracker platform.""" +from collections.abc import AsyncGenerator import json import logging import os from unittest.mock import patch import pytest -from typing_extensions import AsyncGenerator from homeassistant.components.device_tracker.legacy import ( DOMAIN as DT_DOMAIN, diff --git a/tests/components/mysensors/conftest.py b/tests/components/mysensors/conftest.py index f1b86c9ce5b..b6fce35a4c7 100644 --- a/tests/components/mysensors/conftest.py +++ b/tests/components/mysensors/conftest.py @@ -2,7 +2,7 @@ from __future__ import annotations -from collections.abc import Callable +from collections.abc import AsyncGenerator, Callable, Generator from copy import deepcopy import json from typing import Any @@ -12,7 +12,6 @@ from mysensors import BaseSyncGateway from mysensors.persistence import MySensorsJSONDecoder from mysensors.sensor import Sensor import pytest -from typing_extensions import AsyncGenerator, Generator from homeassistant.components.mqtt import DOMAIN as MQTT_DOMAIN from homeassistant.components.mysensors.config_flow import DEFAULT_BAUD_RATE diff --git a/tests/components/mystrom/conftest.py b/tests/components/mystrom/conftest.py index f5405055805..af8d80ed27e 100644 --- a/tests/components/mystrom/conftest.py +++ b/tests/components/mystrom/conftest.py @@ -1,9 +1,9 @@ """Provide common mystrom fixtures and mocks.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.mystrom.const import DOMAIN from homeassistant.const import CONF_HOST diff --git a/tests/components/myuplink/conftest.py b/tests/components/myuplink/conftest.py index dd05bedcaf4..9ede11146ef 100644 --- a/tests/components/myuplink/conftest.py +++ b/tests/components/myuplink/conftest.py @@ -1,5 +1,6 @@ """Test helpers for myuplink.""" +from collections.abc import AsyncGenerator, Generator import time from typing import Any from unittest.mock import MagicMock, patch @@ -7,7 +8,6 @@ from unittest.mock import MagicMock, patch from myuplink import Device, DevicePoint, System import orjson import pytest -from typing_extensions import AsyncGenerator, Generator from homeassistant.components.application_credentials import ( ClientCredential, diff --git a/tests/components/nest/common.py b/tests/components/nest/common.py index bbaa92b7b28..0a553f9c114 100644 --- a/tests/components/nest/common.py +++ b/tests/components/nest/common.py @@ -2,7 +2,7 @@ from __future__ import annotations -from collections.abc import Awaitable, Callable +from collections.abc import Awaitable, Callable, Generator import copy from dataclasses import dataclass, field import time @@ -14,7 +14,6 @@ from google_nest_sdm.device_manager import DeviceManager from google_nest_sdm.event import EventMessage from google_nest_sdm.event_media import CachePolicy from google_nest_sdm.google_nest_subscriber import GoogleNestSubscriber -from typing_extensions import Generator from homeassistant.components.application_credentials import ClientCredential from homeassistant.components.nest import DOMAIN diff --git a/tests/components/nest/conftest.py b/tests/components/nest/conftest.py index de0fc2079fa..4c78bf4c27b 100644 --- a/tests/components/nest/conftest.py +++ b/tests/components/nest/conftest.py @@ -3,6 +3,7 @@ from __future__ import annotations from asyncio import AbstractEventLoop +from collections.abc import Generator import copy import shutil import time @@ -15,7 +16,6 @@ from google_nest_sdm import diagnostics from google_nest_sdm.auth import AbstractAuth from google_nest_sdm.device_manager import DeviceManager import pytest -from typing_extensions import Generator from homeassistant.components.application_credentials import ( async_import_client_credential, diff --git a/tests/components/nest/test_camera.py b/tests/components/nest/test_camera.py index 1838c18b6d4..fd2b5ef0388 100644 --- a/tests/components/nest/test_camera.py +++ b/tests/components/nest/test_camera.py @@ -4,6 +4,7 @@ These tests fake out the subscriber/devicemanager, and are not using a real pubsub subscriber. """ +from collections.abc import Generator import datetime from http import HTTPStatus from unittest.mock import AsyncMock, Mock, patch @@ -12,7 +13,6 @@ import aiohttp from freezegun import freeze_time from google_nest_sdm.event import EventMessage import pytest -from typing_extensions import Generator from homeassistant.components import camera from homeassistant.components.camera import STATE_IDLE, STATE_STREAMING, StreamType diff --git a/tests/components/nest/test_init.py b/tests/components/nest/test_init.py index f9813ca63ee..2beed07a979 100644 --- a/tests/components/nest/test_init.py +++ b/tests/components/nest/test_init.py @@ -8,6 +8,7 @@ mode (e.g. yaml, ConfigEntry, etc) however some tests override and just run in relevant modes. """ +from collections.abc import Generator import logging from typing import Any from unittest.mock import patch @@ -19,7 +20,6 @@ from google_nest_sdm.exceptions import ( SubscriberException, ) import pytest -from typing_extensions import Generator from homeassistant.components.nest import DOMAIN from homeassistant.config_entries import ConfigEntryState diff --git a/tests/components/nest/test_media_source.py b/tests/components/nest/test_media_source.py index f4fb8bdb623..3cfa4ee6687 100644 --- a/tests/components/nest/test_media_source.py +++ b/tests/components/nest/test_media_source.py @@ -4,6 +4,7 @@ These tests simulate recent camera events received by the subscriber exposed as media in the media source. """ +from collections.abc import Generator import datetime from http import HTTPStatus import io @@ -15,7 +16,6 @@ import av from google_nest_sdm.event import EventMessage import numpy as np import pytest -from typing_extensions import Generator from homeassistant.components.media_player.errors import BrowseError from homeassistant.components.media_source import ( diff --git a/tests/components/network/conftest.py b/tests/components/network/conftest.py index 36d9c449d27..d5fbb95a814 100644 --- a/tests/components/network/conftest.py +++ b/tests/components/network/conftest.py @@ -1,9 +1,9 @@ """Tests for the Network Configuration integration.""" +from collections.abc import Generator from unittest.mock import _patch import pytest -from typing_extensions import Generator @pytest.fixture(autouse=True) diff --git a/tests/components/nextbus/test_config_flow.py b/tests/components/nextbus/test_config_flow.py index 0a64bc97d9a..da8e47ff3e8 100644 --- a/tests/components/nextbus/test_config_flow.py +++ b/tests/components/nextbus/test_config_flow.py @@ -1,9 +1,9 @@ """Test the NextBus config flow.""" +from collections.abc import Generator from unittest.mock import MagicMock, patch import pytest -from typing_extensions import Generator from homeassistant import config_entries, setup from homeassistant.components.nextbus.const import CONF_AGENCY, CONF_ROUTE, DOMAIN diff --git a/tests/components/nextbus/test_sensor.py b/tests/components/nextbus/test_sensor.py index 3630ff88855..7cdcd58937a 100644 --- a/tests/components/nextbus/test_sensor.py +++ b/tests/components/nextbus/test_sensor.py @@ -1,12 +1,12 @@ """The tests for the nexbus sensor component.""" +from collections.abc import Generator from copy import deepcopy from unittest.mock import MagicMock, patch from urllib.error import HTTPError from py_nextbus.client import NextBusFormatError, NextBusHTTPError import pytest -from typing_extensions import Generator from homeassistant.components import sensor from homeassistant.components.nextbus.const import CONF_AGENCY, CONF_ROUTE, DOMAIN diff --git a/tests/components/nextcloud/conftest.py b/tests/components/nextcloud/conftest.py index d6cd39e7fc8..cf3eda55fe1 100644 --- a/tests/components/nextcloud/conftest.py +++ b/tests/components/nextcloud/conftest.py @@ -1,9 +1,9 @@ """Fixtrues for the Nextcloud integration tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, Mock, patch import pytest -from typing_extensions import Generator @pytest.fixture diff --git a/tests/components/nibe_heatpump/conftest.py b/tests/components/nibe_heatpump/conftest.py index c44875414e2..47b65772a24 100644 --- a/tests/components/nibe_heatpump/conftest.py +++ b/tests/components/nibe_heatpump/conftest.py @@ -1,12 +1,12 @@ """Test configuration for Nibe Heat Pump.""" +from collections.abc import Generator from contextlib import ExitStack from unittest.mock import AsyncMock, Mock, patch from freezegun.api import FrozenDateTimeFactory from nibe.exceptions import CoilNotFoundException import pytest -from typing_extensions import Generator from homeassistant.core import HomeAssistant diff --git a/tests/components/notify/conftest.py b/tests/components/notify/conftest.py index 0efb3a4689d..91dc92a27fe 100644 --- a/tests/components/notify/conftest.py +++ b/tests/components/notify/conftest.py @@ -1,7 +1,8 @@ """Fixtures for Notify platform tests.""" +from collections.abc import Generator + import pytest -from typing_extensions import Generator from homeassistant.config_entries import ConfigFlow from homeassistant.core import HomeAssistant diff --git a/tests/components/notion/conftest.py b/tests/components/notion/conftest.py index 17bea306ad8..6a6e150c960 100644 --- a/tests/components/notion/conftest.py +++ b/tests/components/notion/conftest.py @@ -1,5 +1,6 @@ """Define fixtures for Notion tests.""" +from collections.abc import Generator import json from unittest.mock import AsyncMock, Mock, patch @@ -8,7 +9,6 @@ from aionotion.listener.models import Listener from aionotion.sensor.models import Sensor from aionotion.user.models import UserPreferences import pytest -from typing_extensions import Generator from homeassistant.components.notion import CONF_REFRESH_TOKEN, CONF_USER_UUID, DOMAIN from homeassistant.const import CONF_USERNAME diff --git a/tests/components/number/test_init.py b/tests/components/number/test_init.py index aa5df5d737f..55dad2506f1 100644 --- a/tests/components/number/test_init.py +++ b/tests/components/number/test_init.py @@ -1,10 +1,10 @@ """The tests for the Number component.""" +from collections.abc import Generator from typing import Any from unittest.mock import MagicMock import pytest -from typing_extensions import Generator from homeassistant.components.number import ( ATTR_MAX, diff --git a/tests/components/obihai/conftest.py b/tests/components/obihai/conftest.py index c4edfdedf65..ef54c12ba26 100644 --- a/tests/components/obihai/conftest.py +++ b/tests/components/obihai/conftest.py @@ -1,10 +1,10 @@ """Define test fixtures for Obihai.""" +from collections.abc import Generator from socket import gaierror from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator @pytest.fixture diff --git a/tests/components/onboarding/test_views.py b/tests/components/onboarding/test_views.py index e9ba720adb3..3b6e6f5dbe3 100644 --- a/tests/components/onboarding/test_views.py +++ b/tests/components/onboarding/test_views.py @@ -1,13 +1,13 @@ """Test the onboarding views.""" import asyncio +from collections.abc import AsyncGenerator from http import HTTPStatus import os from typing import Any from unittest.mock import Mock, patch import pytest -from typing_extensions import AsyncGenerator from homeassistant.components import onboarding from homeassistant.components.onboarding import const, views diff --git a/tests/components/ondilo_ico/conftest.py b/tests/components/ondilo_ico/conftest.py index 6a03d6961c2..a847c1df069 100644 --- a/tests/components/ondilo_ico/conftest.py +++ b/tests/components/ondilo_ico/conftest.py @@ -1,10 +1,10 @@ """Provide basic Ondilo fixture.""" +from collections.abc import Generator from typing import Any from unittest.mock import MagicMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.ondilo_ico.const import DOMAIN diff --git a/tests/components/onewire/conftest.py b/tests/components/onewire/conftest.py index 47b50ab10e0..65a86b58f2f 100644 --- a/tests/components/onewire/conftest.py +++ b/tests/components/onewire/conftest.py @@ -1,10 +1,10 @@ """Provide common 1-Wire fixtures.""" +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch from pyownet.protocol import ConnError import pytest -from typing_extensions import Generator from homeassistant.components.onewire.const import DOMAIN from homeassistant.config_entries import SOURCE_USER, ConfigEntry diff --git a/tests/components/onewire/test_binary_sensor.py b/tests/components/onewire/test_binary_sensor.py index 8b1129529d5..31895f705ff 100644 --- a/tests/components/onewire/test_binary_sensor.py +++ b/tests/components/onewire/test_binary_sensor.py @@ -1,10 +1,10 @@ """Tests for 1-Wire binary sensors.""" +from collections.abc import Generator from unittest.mock import MagicMock, patch import pytest from syrupy.assertion import SnapshotAssertion -from typing_extensions import Generator from homeassistant.config_entries import ConfigEntry from homeassistant.const import Platform diff --git a/tests/components/onewire/test_diagnostics.py b/tests/components/onewire/test_diagnostics.py index 62b045c4516..ecdae859597 100644 --- a/tests/components/onewire/test_diagnostics.py +++ b/tests/components/onewire/test_diagnostics.py @@ -1,10 +1,10 @@ """Test 1-Wire diagnostics.""" +from collections.abc import Generator from unittest.mock import MagicMock, patch import pytest from syrupy.assertion import SnapshotAssertion -from typing_extensions import Generator from homeassistant.config_entries import ConfigEntry from homeassistant.const import Platform diff --git a/tests/components/onewire/test_sensor.py b/tests/components/onewire/test_sensor.py index df0a81920c9..ba0e21701f8 100644 --- a/tests/components/onewire/test_sensor.py +++ b/tests/components/onewire/test_sensor.py @@ -1,5 +1,6 @@ """Tests for 1-Wire sensors.""" +from collections.abc import Generator from copy import deepcopy import logging from unittest.mock import MagicMock, _patch_dict, patch @@ -7,7 +8,6 @@ from unittest.mock import MagicMock, _patch_dict, patch from pyownet.protocol import OwnetError import pytest from syrupy.assertion import SnapshotAssertion -from typing_extensions import Generator from homeassistant.config_entries import ConfigEntry from homeassistant.const import Platform diff --git a/tests/components/onewire/test_switch.py b/tests/components/onewire/test_switch.py index b1b8e5ddbd0..936e83f66ec 100644 --- a/tests/components/onewire/test_switch.py +++ b/tests/components/onewire/test_switch.py @@ -1,10 +1,10 @@ """Tests for 1-Wire switches.""" +from collections.abc import Generator from unittest.mock import MagicMock, patch import pytest from syrupy.assertion import SnapshotAssertion -from typing_extensions import Generator from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.config_entries import ConfigEntry diff --git a/tests/components/open_meteo/conftest.py b/tests/components/open_meteo/conftest.py index 0d3e1274693..22138846915 100644 --- a/tests/components/open_meteo/conftest.py +++ b/tests/components/open_meteo/conftest.py @@ -2,11 +2,11 @@ from __future__ import annotations +from collections.abc import Generator from unittest.mock import MagicMock, patch from open_meteo import Forecast import pytest -from typing_extensions import Generator from homeassistant.components.open_meteo.const import DOMAIN from homeassistant.const import CONF_ZONE diff --git a/tests/components/openexchangerates/conftest.py b/tests/components/openexchangerates/conftest.py index 6bd7da2c7af..770432ebac3 100644 --- a/tests/components/openexchangerates/conftest.py +++ b/tests/components/openexchangerates/conftest.py @@ -1,9 +1,9 @@ """Provide common fixtures for tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.openexchangerates.const import DOMAIN diff --git a/tests/components/openexchangerates/test_config_flow.py b/tests/components/openexchangerates/test_config_flow.py index 30ea619d646..ec06c662201 100644 --- a/tests/components/openexchangerates/test_config_flow.py +++ b/tests/components/openexchangerates/test_config_flow.py @@ -1,6 +1,7 @@ """Test the Open Exchange Rates config flow.""" import asyncio +from collections.abc import Generator from typing import Any from unittest.mock import AsyncMock, patch @@ -9,7 +10,6 @@ from aioopenexchangerates import ( OpenExchangeRatesClientError, ) import pytest -from typing_extensions import Generator from homeassistant import config_entries from homeassistant.components.openexchangerates.const import DOMAIN diff --git a/tests/components/opengarage/conftest.py b/tests/components/opengarage/conftest.py index c960e723289..2367692096b 100644 --- a/tests/components/opengarage/conftest.py +++ b/tests/components/opengarage/conftest.py @@ -2,10 +2,10 @@ from __future__ import annotations +from collections.abc import Generator from unittest.mock import MagicMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.opengarage.const import CONF_DEVICE_KEY, DOMAIN from homeassistant.const import CONF_HOST, CONF_PORT, CONF_VERIFY_SSL diff --git a/tests/components/opensky/conftest.py b/tests/components/opensky/conftest.py index c48f3bec8d8..4664c48ef9e 100644 --- a/tests/components/opensky/conftest.py +++ b/tests/components/opensky/conftest.py @@ -1,10 +1,10 @@ """Configure tests for the OpenSky integration.""" +from collections.abc import AsyncGenerator, Generator from unittest.mock import AsyncMock, patch import pytest from python_opensky import StatesResponse -from typing_extensions import AsyncGenerator, Generator from homeassistant.components.opensky.const import ( CONF_ALTITUDE, diff --git a/tests/components/openuv/conftest.py b/tests/components/openuv/conftest.py index 69563c94c64..cc344d25ccb 100644 --- a/tests/components/openuv/conftest.py +++ b/tests/components/openuv/conftest.py @@ -1,10 +1,10 @@ """Define test fixtures for OpenUV.""" +from collections.abc import Generator import json from unittest.mock import AsyncMock, Mock, patch import pytest -from typing_extensions import Generator from homeassistant.components.openuv import CONF_FROM_WINDOW, CONF_TO_WINDOW, DOMAIN from homeassistant.const import ( diff --git a/tests/components/opower/test_config_flow.py b/tests/components/opower/test_config_flow.py index a236494f2c9..8134539b0a5 100644 --- a/tests/components/opower/test_config_flow.py +++ b/tests/components/opower/test_config_flow.py @@ -1,10 +1,10 @@ """Test the Opower config flow.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch from opower import CannotConnect, InvalidAuth import pytest -from typing_extensions import Generator from homeassistant import config_entries from homeassistant.components.opower.const import DOMAIN diff --git a/tests/components/oralb/conftest.py b/tests/components/oralb/conftest.py index fa4ba463357..c757d79a78e 100644 --- a/tests/components/oralb/conftest.py +++ b/tests/components/oralb/conftest.py @@ -1,9 +1,9 @@ """OralB session fixtures.""" +from collections.abc import Generator from unittest import mock import pytest -from typing_extensions import Generator class MockServices: diff --git a/tests/components/ourgroceries/conftest.py b/tests/components/ourgroceries/conftest.py index bc8c632b511..b3fb4e9bcc6 100644 --- a/tests/components/ourgroceries/conftest.py +++ b/tests/components/ourgroceries/conftest.py @@ -1,9 +1,9 @@ """Common fixtures for the OurGroceries tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.ourgroceries import DOMAIN from homeassistant.const import CONF_PASSWORD, CONF_USERNAME diff --git a/tests/components/overkiz/conftest.py b/tests/components/overkiz/conftest.py index 8ab26e3587b..151d0719ddb 100644 --- a/tests/components/overkiz/conftest.py +++ b/tests/components/overkiz/conftest.py @@ -1,9 +1,9 @@ """Configuration for overkiz tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, Mock, patch import pytest -from typing_extensions import Generator from homeassistant.components.overkiz.const import DOMAIN from homeassistant.core import HomeAssistant diff --git a/tests/components/permobil/conftest.py b/tests/components/permobil/conftest.py index ed6a843b206..d3630d3f366 100644 --- a/tests/components/permobil/conftest.py +++ b/tests/components/permobil/conftest.py @@ -1,10 +1,10 @@ """Common fixtures for the MyPermobil tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, Mock, patch from mypermobil import MyPermobil import pytest -from typing_extensions import Generator from .const import MOCK_REGION_NAME, MOCK_TOKEN, MOCK_URL diff --git a/tests/components/philips_js/conftest.py b/tests/components/philips_js/conftest.py index b6c78fe9e5e..2a1325627ee 100644 --- a/tests/components/philips_js/conftest.py +++ b/tests/components/philips_js/conftest.py @@ -1,10 +1,10 @@ """Standard setup for tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, create_autospec, patch from haphilipsjs import PhilipsTV import pytest -from typing_extensions import Generator from homeassistant.components.philips_js.const import DOMAIN diff --git a/tests/components/ping/test_device_tracker.py b/tests/components/ping/test_device_tracker.py index 5aa425226b3..4a5d6ba94ed 100644 --- a/tests/components/ping/test_device_tracker.py +++ b/tests/components/ping/test_device_tracker.py @@ -1,12 +1,12 @@ """Test the binary sensor platform of ping.""" +from collections.abc import Generator from datetime import timedelta from unittest.mock import patch from freezegun.api import FrozenDateTimeFactory from icmplib import Host import pytest -from typing_extensions import Generator from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er diff --git a/tests/components/plex/conftest.py b/tests/components/plex/conftest.py index a061d9c1105..53c032cb08b 100644 --- a/tests/components/plex/conftest.py +++ b/tests/components/plex/conftest.py @@ -1,10 +1,10 @@ """Fixtures for Plex tests.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest import requests_mock -from typing_extensions import Generator from homeassistant.components.plex.const import DOMAIN, PLEX_SERVER_CONFIG, SERVERS from homeassistant.const import CONF_URL diff --git a/tests/components/plugwise/conftest.py b/tests/components/plugwise/conftest.py index 83826a0a543..ec857a965e5 100644 --- a/tests/components/plugwise/conftest.py +++ b/tests/components/plugwise/conftest.py @@ -2,13 +2,13 @@ from __future__ import annotations +from collections.abc import Generator import json from typing import Any from unittest.mock import AsyncMock, MagicMock, patch from plugwise import PlugwiseData import pytest -from typing_extensions import Generator from homeassistant.components.plugwise.const import DOMAIN from homeassistant.const import ( diff --git a/tests/components/poolsense/conftest.py b/tests/components/poolsense/conftest.py index ac16ef23ff3..6a842df7cfd 100644 --- a/tests/components/poolsense/conftest.py +++ b/tests/components/poolsense/conftest.py @@ -1,10 +1,10 @@ """Common fixtures for the Poolsense tests.""" +from collections.abc import Generator from datetime import UTC, datetime from unittest.mock import AsyncMock, patch import pytest -from typing_extensions import Generator from homeassistant.components.poolsense.const import DOMAIN from homeassistant.const import CONF_EMAIL, CONF_PASSWORD diff --git a/tests/components/prosegur/test_alarm_control_panel.py b/tests/components/prosegur/test_alarm_control_panel.py index b65b86b3049..f66d070f218 100644 --- a/tests/components/prosegur/test_alarm_control_panel.py +++ b/tests/components/prosegur/test_alarm_control_panel.py @@ -1,10 +1,10 @@ """Tests for the Prosegur alarm control panel device.""" +from collections.abc import Generator from unittest.mock import AsyncMock, patch from pyprosegur.installation import Status import pytest -from typing_extensions import Generator from homeassistant.components.alarm_control_panel import DOMAIN as ALARM_DOMAIN from homeassistant.const import ( diff --git a/tests/components/ps4/conftest.py b/tests/components/ps4/conftest.py index bc84ea3b4db..c95cc78f53a 100644 --- a/tests/components/ps4/conftest.py +++ b/tests/components/ps4/conftest.py @@ -1,10 +1,10 @@ """Test configuration for PS4.""" +from collections.abc import Generator from unittest.mock import MagicMock, patch from pyps4_2ndscreen.ddp import DEFAULT_UDP_PORT, DDPProtocol import pytest -from typing_extensions import Generator @pytest.fixture diff --git a/tests/components/pure_energie/conftest.py b/tests/components/pure_energie/conftest.py index 7174befbf5b..9aa3a4cc1b4 100644 --- a/tests/components/pure_energie/conftest.py +++ b/tests/components/pure_energie/conftest.py @@ -1,11 +1,11 @@ """Fixtures for Pure Energie integration tests.""" +from collections.abc import Generator import json from unittest.mock import AsyncMock, MagicMock, patch from gridnet import Device as GridNetDevice, SmartBridge import pytest -from typing_extensions import Generator from homeassistant.components.pure_energie.const import DOMAIN from homeassistant.const import CONF_HOST diff --git a/tests/components/pvoutput/conftest.py b/tests/components/pvoutput/conftest.py index d19f09d9e6c..a55bb21d2ae 100644 --- a/tests/components/pvoutput/conftest.py +++ b/tests/components/pvoutput/conftest.py @@ -2,11 +2,11 @@ from __future__ import annotations +from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch from pvo import Status, System import pytest -from typing_extensions import Generator from homeassistant.components.pvoutput.const import CONF_SYSTEM_ID, DOMAIN from homeassistant.const import CONF_API_KEY