Update typing - collections.abc (3) (#63947)

This commit is contained in:
Marc Mueller 2022-01-12 08:04:17 +01:00 committed by GitHub
parent 12757a8cd2
commit d057850971
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 42 additions and 33 deletions

View File

@ -2,8 +2,9 @@
from __future__ import annotations
import asyncio
from collections.abc import Iterable
import logging
from typing import Any, Iterable
from typing import Any
from homeassistant.const import (
ATTR_ENTITY_ID,

View File

@ -4,6 +4,7 @@ from __future__ import annotations
import asyncio
import collections
from collections import OrderedDict
from collections.abc import Awaitable, Collection
from contextlib import contextmanager
from datetime import datetime, timedelta
import functools as ft
@ -16,7 +17,7 @@ import threading
import time
from time import monotonic
import types
from typing import Any, Awaitable, Collection
from typing import Any
from unittest.mock import AsyncMock, Mock, patch
from aiohttp.test_utils import unused_port as get_test_instance_port # noqa: F401

View File

@ -1,7 +1,7 @@
"""Test the Amber Electric Sensors."""
from __future__ import annotations
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
from unittest.mock import Mock, patch
from amberelectric.model.channel import ChannelType

View File

@ -1,6 +1,6 @@
"""Tests for the Amber config flow."""
from typing import Generator
from collections.abc import Generator
from unittest.mock import Mock, patch
from amberelectric import ApiException

View File

@ -1,7 +1,7 @@
"""Tests for the Amber Electric Data Coordinator."""
from __future__ import annotations
from typing import Generator
from collections.abc import Generator
from unittest.mock import Mock, patch
from amberelectric import ApiException

View File

@ -1,5 +1,5 @@
"""Test the Amber Electric Sensors."""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
from unittest.mock import Mock, patch
from amberelectric.model.current_interval import CurrentInterval

View File

@ -2,8 +2,8 @@
from __future__ import annotations
from asyncio import AbstractEventLoop
from collections.abc import Callable
from dataclasses import dataclass
from typing import Callable
from unittest.mock import patch
import pytest

View File

@ -1,7 +1,8 @@
"""Tests for the Crownstone integration."""
from __future__ import annotations
from typing import Generator, Union
from collections.abc import Generator
from typing import Union
from unittest.mock import AsyncMock, MagicMock, patch
from crownstone_cloud.cloud_models.spheres import Spheres

View File

@ -2,9 +2,9 @@
from __future__ import annotations
import asyncio
from collections.abc import Callable
from contextlib import contextmanager
import datetime
from typing import Callable
from unittest.mock import AsyncMock, MagicMock, patch
from flux_led import DeviceType

View File

@ -1,7 +1,7 @@
"""Fixtures for Forecast.Solar integration tests."""
from collections.abc import Generator
from datetime import datetime, timedelta
from typing import Generator
from unittest.mock import MagicMock, patch
from forecast_solar import models

View File

@ -2,9 +2,10 @@
from __future__ import annotations
from collections.abc import Callable
import copy
from http import HTTPStatus
from typing import Any, Callable
from typing import Any
from unittest.mock import Mock, patch
import httplib2

View File

@ -1,7 +1,7 @@
"""Configuration for HEOS tests."""
from __future__ import annotations
from typing import Sequence
from collections.abc import Sequence
from unittest.mock import Mock, patch as patch
from pyheos import (

View File

@ -3,8 +3,7 @@ from __future__ import annotations
import asyncio
import base64
from collections.abc import Awaitable
from typing import Callable
from collections.abc import Awaitable, Callable
from unittest.mock import AsyncMock, Mock, patch
from aiohttp import web

View File

@ -1,7 +1,7 @@
"""Tests for the Modern Forms integration."""
from collections.abc import Callable
import json
from typing import Callable
from aiomodernforms.const import COMMAND_QUERY_STATIC_DATA

View File

@ -1,9 +1,9 @@
"""Provide common mysensors fixtures."""
from __future__ import annotations
from collections.abc import AsyncGenerator, Generator
from collections.abc import AsyncGenerator, Callable, Generator
import json
from typing import Any, Callable
from typing import Any
from unittest.mock import MagicMock, patch
from mysensors.persistence import MySensorsJSONDecoder

View File

@ -1,7 +1,7 @@
"""Provide tests for mysensors sensor platform."""
from __future__ import annotations
from typing import Callable
from collections.abc import Callable
from mysensors.sensor import Sensor
import pytest

View File

@ -1,7 +1,7 @@
"""Common libraries for test setup."""
from collections.abc import Awaitable, Callable
import time
from typing import Awaitable, Callable
from unittest.mock import patch
from google_nest_sdm.device_manager import DeviceManager

View File

@ -4,9 +4,9 @@ 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
from typing import Generator
from unittest.mock import patch
import aiohttp

View File

@ -1,8 +1,8 @@
"""Common test tools."""
from __future__ import annotations
from collections.abc import AsyncGenerator
from typing import Awaitable, Callable, cast
from collections.abc import AsyncGenerator, Awaitable, Callable
from typing import cast
from unittest.mock import patch
import pytest

View File

@ -3,7 +3,8 @@
from __future__ import annotations
import base64
from typing import Any, AsyncGenerator, Awaitable, Callable
from collections.abc import AsyncGenerator, Awaitable, Callable
from typing import Any
from unittest.mock import patch
import aiohttp

View File

@ -1,8 +1,8 @@
"""Test script blueprints."""
import asyncio
from collections.abc import Iterator
import contextlib
import pathlib
from typing import Iterator
from unittest.mock import patch
from homeassistant.components import script

View File

@ -1,9 +1,10 @@
"""Test the Shark IQ vacuum entity."""
from __future__ import annotations
from collections.abc import Iterable
from copy import deepcopy
import enum
from typing import Any, Iterable
from typing import Any
from unittest.mock import patch
import pytest

View File

@ -1,9 +1,10 @@
"""The test for the statistics sensor platform."""
from __future__ import annotations
from collections.abc import Sequence
from datetime import datetime, timedelta
import statistics
from typing import Any, Sequence
from typing import Any
from unittest.mock import patch
from homeassistant import config as hass_config

View File

@ -2,11 +2,12 @@
# pylint: disable=protected-access
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from datetime import timedelta
from ipaddress import IPv4Address
import json
from typing import Any, Callable
from typing import Any
from unittest.mock import AsyncMock, Mock, patch
import pytest

View File

@ -1,7 +1,7 @@
"""Configuration for SSDP tests."""
from __future__ import annotations
from typing import Sequence
from collections.abc import Sequence
from unittest.mock import AsyncMock, MagicMock, patch
from urllib.parse import urlparse

View File

@ -1,8 +1,9 @@
"""Common code for tests."""
from __future__ import annotations
from collections.abc import Callable
from enum import Enum
from typing import Callable, NamedTuple
from typing import NamedTuple
from unittest.mock import MagicMock
import pyvera as pv

View File

@ -1,7 +1,8 @@
"""Vera tests."""
from __future__ import annotations
from typing import Any, Callable
from collections.abc import Callable
from typing import Any
from unittest.mock import MagicMock
import pyvera as pv

View File

@ -1,6 +1,6 @@
"""Fixtures for WLED integration tests."""
from collections.abc import Generator
import json
from typing import Generator
from unittest.mock import MagicMock, patch
import pytest

View File

@ -1,7 +1,7 @@
"""Tests for the coordinator of the WLED integration."""
import asyncio
from collections.abc import Callable
from copy import deepcopy
from typing import Callable
from unittest.mock import MagicMock
import pytest

View File

@ -1,6 +1,6 @@
"""Tests for the WLED integration."""
import asyncio
from typing import Callable
from collections.abc import Callable
from unittest.mock import AsyncMock, MagicMock, patch
import pytest