1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Use PEP 695 for decorator typing (3) (#117640)

This commit is contained in:
Marc Mueller
2024-05-17 16:27:32 +02:00
committed by GitHub
parent 34bd291615
commit 25d1ca747b
14 changed files with 31 additions and 76 deletions

View File

@@ -14,7 +14,7 @@ import reprlib
import sqlite3
import ssl
import threading
from typing import TYPE_CHECKING, Any, ParamSpec, TypeVar, cast
from typing import TYPE_CHECKING, Any, cast
from unittest.mock import AsyncMock, MagicMock, Mock, patch
from aiohttp import client
@@ -204,11 +204,7 @@ class HAFakeDatetime(freezegun.api.FakeDatetime): # type: ignore[name-defined]
return ha_datetime_to_fakedatetime(result)
_R = TypeVar("_R")
_P = ParamSpec("_P")
def check_real(func: Callable[_P, Coroutine[Any, Any, _R]]):
def check_real[**_P, _R](func: Callable[_P, Coroutine[Any, Any, _R]]):
"""Force a function to require a keyword _test_real to be passed in."""
@functools.wraps(func)