diff --git a/ax/utils/common/tests/test_kwargutils.py b/ax/utils/common/tests/test_kwargutils.py index fcc5c25d62f..80199e0391b 100644 --- a/ax/utils/common/tests/test_kwargutils.py +++ b/ax/utils/common/tests/test_kwargutils.py @@ -8,7 +8,7 @@ from logging import Logger -from typing import Callable, Optional +from typing import Callable, Dict, Optional from unittest.mock import patch from ax.utils.common.kwargs import validate_kwarg_typing, warn_on_kwargs @@ -23,7 +23,7 @@ def test_validate_kwarg_typing(self) -> None: def typed_callable(arg1: int, arg2: Optional[str] = None) -> None: pass - def typed_callable_with_dict(arg3: int, arg4: dict[str, int]) -> None: + def typed_callable_with_dict(arg3: int, arg4: Dict[str, int]) -> None: pass def typed_callable_valid(arg3: int, arg4: Optional[str] = None) -> None: @@ -33,7 +33,7 @@ def typed_callable_dup_keyword(arg2: int, arg4: Optional[str] = None) -> None: pass def typed_callable_with_callable( - arg1: int, arg2: Callable[[int], dict[str, int]] + arg1: int, arg2: Callable[[int], Dict[str, int]] ) -> None: pass @@ -102,7 +102,7 @@ def typed_callable_extra_arg(arg1: int, arg2: str, arg3: bool) -> None: validate_kwarg_typing(typed_callables, **kwargs) expected_message = ( f"`{typed_callable_with_dict}` expected argument `arg4` to be of type" - f" dict[str, int]. Got {str_dic} (type: {type(str_dic)})." + f" typing.Dict[str, int]. Got {str_dic} (type: {type(str_dic)})." ) mock_warning.assert_called_once_with(expected_message) @@ -113,7 +113,7 @@ def typed_callable_extra_arg(arg1: int, arg2: str, arg3: bool) -> None: validate_kwarg_typing(typed_callables, **kwargs) expected_message = ( f"`{typed_callable_with_callable}` expected argument `arg2` to be of" - f" type typing.Callable[[int], dict[str, int]]. " + f" type typing.Callable[[int], typing.Dict[str, int]]. " f"Got test_again (type: {type('test_again')})." ) mock_warning.assert_called_once_with(expected_message)