diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91bda72e616..bbf7295be99 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.34.0 + rev: v2.37.1 hooks: - id: pyupgrade args: [--py39-plus] diff --git a/requirements_test_pre_commit.txt b/requirements_test_pre_commit.txt index caed3668db7..b1a9a0a1a5b 100644 --- a/requirements_test_pre_commit.txt +++ b/requirements_test_pre_commit.txt @@ -12,5 +12,5 @@ mccabe==0.6.1 pycodestyle==2.8.0 pydocstyle==6.1.1 pyflakes==2.4.0 -pyupgrade==2.34.0 +pyupgrade==2.37.1 yamllint==1.27.1 diff --git a/tests/components/august/mocks.py b/tests/components/august/mocks.py index c93e6429f1c..932065f37da 100644 --- a/tests/components/august/mocks.py +++ b/tests/components/august/mocks.py @@ -1,10 +1,11 @@ """Mocks for the august component.""" from __future__ import annotations +from collections.abc import Iterable import json import os import time -from typing import Any, Iterable +from typing import Any from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch from yalexs.activity import ( diff --git a/tests/components/calendar/test_trigger.py b/tests/components/calendar/test_trigger.py index a3b5bacca59..ebe5e9185e4 100644 --- a/tests/components/calendar/test_trigger.py +++ b/tests/components/calendar/test_trigger.py @@ -8,11 +8,11 @@ forward exercising the triggers. """ from __future__ import annotations -from collections.abc import Callable +from collections.abc import Callable, Generator import datetime import logging import secrets -from typing import Any, Generator +from typing import Any from unittest.mock import patch import pytest diff --git a/tests/components/google/conftest.py b/tests/components/google/conftest.py index f47d1232582..7e668de2891 100644 --- a/tests/components/google/conftest.py +++ b/tests/components/google/conftest.py @@ -1,10 +1,10 @@ """Test configuration and mocks for the google integration.""" from __future__ import annotations -from collections.abc import Awaitable, Callable +from collections.abc import Awaitable, Callable, Generator import datetime import http -from typing import Any, Generator, TypeVar +from typing import Any, TypeVar from unittest.mock import Mock, mock_open, patch from aiohttp.client_exceptions import ClientError diff --git a/tests/components/nest/common.py b/tests/components/nest/common.py index f86112ada75..fbdc2665879 100644 --- a/tests/components/nest/common.py +++ b/tests/components/nest/common.py @@ -2,11 +2,11 @@ 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 -from typing import Any, Generator, TypeVar +from typing import Any, TypeVar from google_nest_sdm.auth import AbstractAuth from google_nest_sdm.device import Device diff --git a/tests/components/stream/conftest.py b/tests/components/stream/conftest.py index 91b4106c1f4..ff1a66a1215 100644 --- a/tests/components/stream/conftest.py +++ b/tests/components/stream/conftest.py @@ -12,10 +12,10 @@ so that it can inspect the output. from __future__ import annotations import asyncio +from collections.abc import Generator from http import HTTPStatus import logging import threading -from typing import Generator from unittest.mock import Mock, patch from aiohttp import web diff --git a/tests/components/unifiprotect/utils.py b/tests/components/unifiprotect/utils.py index 260c6996128..8d54cbddea6 100644 --- a/tests/components/unifiprotect/utils.py +++ b/tests/components/unifiprotect/utils.py @@ -2,9 +2,10 @@ # pylint: disable=protected-access from __future__ import annotations +from collections.abc import Sequence from dataclasses import dataclass from datetime import timedelta -from typing import Any, Callable, Sequence +from typing import Any, Callable from unittest.mock import Mock from pyunifiprotect import ProtectApiClient