Import Generator from collections.abc (3) (#120916)

pull/120921/head
Marc Mueller 2024-07-01 12:09:11 +02:00 committed by GitHub
parent 2f0dd6f704
commit 921430d497
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
129 changed files with 131 additions and 138 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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,

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 (

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 (

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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,

View File

@ -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 (

View File

@ -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

View File

@ -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

View File

@ -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 (

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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()}"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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 (

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

Some files were not shown because too many files have changed in this diff Show More