aboutsummaryrefslogtreecommitdiff
path: root/tests/test_tools_metadata_common.py
diff options
context:
space:
mode:
authorDmitrii Agibov <dmitrii.agibov@arm.com>2022-09-08 14:24:39 +0100
committerDmitrii Agibov <dmitrii.agibov@arm.com>2022-09-09 17:21:48 +0100
commitf5b293d0927506c2a979a091bf0d07ecc78fa181 (patch)
tree4de585b7cb6ed34da8237063752270189a730a41 /tests/test_tools_metadata_common.py
parentcde0c6ee140bd108849bff40467d8f18ffc332ef (diff)
downloadmlia-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_tools_metadata_common.py')
-rw-r--r--tests/test_tools_metadata_common.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_tools_metadata_common.py b/tests/test_tools_metadata_common.py
index 7663b83..69bc3e5 100644
--- a/tests/test_tools_metadata_common.py
+++ b/tests/test_tools_metadata_common.py
@@ -1,10 +1,10 @@
# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Tests for commmon installation related functions."""
+from __future__ import annotations
+
from pathlib import Path
from typing import Any
-from typing import List
-from typing import Optional
from unittest.mock import call
from unittest.mock import MagicMock
from unittest.mock import PropertyMock
@@ -22,7 +22,7 @@ def get_installation_mock(
name: str,
already_installed: bool = False,
could_be_installed: bool = False,
- supported_install_type: Optional[type] = None,
+ supported_install_type: type | None = None,
) -> MagicMock:
"""Get mock instance for the installation."""
mock = MagicMock(spec=Installation)
@@ -81,7 +81,7 @@ def _could_be_installed_from_mock() -> MagicMock:
def get_installation_manager(
noninteractive: bool,
- installations: List[Any],
+ installations: list[Any],
monkeypatch: pytest.MonkeyPatch,
yes_response: bool = True,
) -> DefaultInstallationManager:
@@ -146,7 +146,7 @@ def test_installation_manager_download_and_install(
install_mock: MagicMock,
noninteractive: bool,
eula_agreement: bool,
- backend_name: Optional[str],
+ backend_name: str | None,
expected_call: Any,
monkeypatch: pytest.MonkeyPatch,
) -> None:
@@ -183,7 +183,7 @@ def test_installation_manager_download_and_install(
def test_installation_manager_install_from(
install_mock: MagicMock,
noninteractive: bool,
- backend_name: Optional[str],
+ backend_name: str | None,
expected_call: Any,
monkeypatch: pytest.MonkeyPatch,
) -> None: