diff options
author | Dmitrii Agibov <dmitrii.agibov@arm.com> | 2022-09-08 14:24:39 +0100 |
---|---|---|
committer | Dmitrii Agibov <dmitrii.agibov@arm.com> | 2022-09-09 17:21:48 +0100 |
commit | f5b293d0927506c2a979a091bf0d07ecc78fa181 (patch) | |
tree | 4de585b7cb6ed34da8237063752270189a730a41 /tests/test_backend_system.py | |
parent | cde0c6ee140bd108849bff40467d8f18ffc332ef (diff) | |
download | mlia-f5b293d0927506c2a979a091bf0d07ecc78fa181.tar.gz |
MLIA-386 Simplify typing in the source code
- Enable deferred annotations evaluation
- Use builtin types for type hints whenever possible
- Use | syntax for union types
- Rename mlia.core._typing into mlia.core.typing
Change-Id: I3f6ffc02fa069c589bdd9e8bddbccd504285427a
Diffstat (limited to 'tests/test_backend_system.py')
-rw-r--r-- | tests/test_backend_system.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/test_backend_system.py b/tests/test_backend_system.py index 13347c6..7a8b1de 100644 --- a/tests/test_backend_system.py +++ b/tests/test_backend_system.py @@ -1,14 +1,12 @@ # SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. # SPDX-License-Identifier: Apache-2.0 """Tests for system backend.""" +from __future__ import annotations + from contextlib import ExitStack as does_not_raise from pathlib import Path from typing import Any from typing import Callable -from typing import Dict -from typing import List -from typing import Optional -from typing import Tuple from unittest.mock import MagicMock import pytest @@ -27,12 +25,12 @@ from mlia.backend.system import System def dummy_resolver( - values: Optional[Dict[str, str]] = None -) -> Callable[[str, str, List[Tuple[Optional[str], Param]]], str]: + values: dict[str, str] | None = None +) -> Callable[[str, str, list[tuple[str | None, Param]]], str]: """Return dummy parameter resolver implementation.""" # pylint: disable=unused-argument def resolver( - param: str, cmd: str, param_values: List[Tuple[Optional[str], Param]] + param: str, cmd: str, param_values: list[tuple[str | None, Param]] ) -> str: """Implement dummy parameter resolver.""" return values.get(param, "") if values else "" |