mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-03-26 21:33:25 +00:00
Avoid deprecated typing.Callable. (#959)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user