Avoid deprecated typing.Callable. (#959)

This commit is contained in:
Felix Fontein
2025-10-17 08:48:27 +02:00
committed by GitHub
parent bd5f3b4c7c
commit 250230e763
15 changed files with 39 additions and 28 deletions

View File

@@ -5,6 +5,7 @@
from __future__ import annotations
import typing as t
from collections.abc import Callable
from unittest.mock import (
MagicMock,
)
@@ -113,7 +114,7 @@ def create_error_response() -> MagicMock:
return response
def create_decode_error(msg: str) -> t.Callable[[t.Any], t.Any]:
def create_decode_error(msg: str) -> Callable[[t.Any], t.Any]:
def f(content: t.Any) -> t.NoReturn:
raise Exception(msg)
@@ -121,7 +122,7 @@ def create_decode_error(msg: str) -> t.Callable[[t.Any], t.Any]:
TEST_ACME_PROTOCOL_EXCEPTION: list[
tuple[dict[str, t.Any], t.Callable[[t.Any], t.Any] | None, str, dict[str, t.Any]]
tuple[dict[str, t.Any], Callable[[t.Any], t.Any] | None, str, dict[str, t.Any]]
] = [
(
{},
@@ -351,7 +352,7 @@ TEST_ACME_PROTOCOL_EXCEPTION: list[
)
def test_acme_protocol_exception(
parameters: dict[str, t.Any],
from_json: t.Callable[[t.Any], t.NoReturn] | None,
from_json: Callable[[t.Any], t.NoReturn] | None,
msg: str,
args: dict[str, t.Any],
) -> None: