diff options
author | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-04-14 19:47:25 +0200 |
---|---|---|
committer | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-04-14 20:06:24 +0200 |
commit | a693ea7e1785def007c5a80d379cc7aaf92f38a9 (patch) | |
tree | 30c130828abae0b2bc7c1a037e45886d7bf26a99 /tests/message | |
parent | 8f872bf49c344d1d16b3573136d53b2cbda007c6 (diff) | |
download | pylint-git-a693ea7e1785def007c5a80d379cc7aaf92f38a9.tar.gz |
Use ``python-typing-update`` on second half of the ``tests`` directory
Diffstat (limited to 'tests/message')
-rw-r--r-- | tests/message/conftest.py | 7 | ||||
-rw-r--r-- | tests/message/unittest_message.py | 4 | ||||
-rw-r--r-- | tests/message/unittest_message_id_store.py | 8 |
3 files changed, 12 insertions, 7 deletions
diff --git a/tests/message/conftest.py b/tests/message/conftest.py index 76a18c037..e41057835 100644 --- a/tests/message/conftest.py +++ b/tests/message/conftest.py @@ -4,8 +4,9 @@ # pylint: disable=redefined-outer-name +from __future__ import annotations -from typing import Dict, ValuesView +from collections.abc import ValuesView import pytest @@ -63,7 +64,7 @@ def message_definitions(store: MessageDefinitionStore) -> ValuesView[MessageDefi @pytest.fixture -def msgids() -> Dict[str, str]: +def msgids() -> dict[str, str]: return { "W1234": "warning-symbol", "W1235": "warning-symbol-two", @@ -78,7 +79,7 @@ def empty_msgid_store() -> MessageIdStore: @pytest.fixture -def msgid_store(msgids: Dict[str, str]) -> MessageIdStore: +def msgid_store(msgids: dict[str, str]) -> MessageIdStore: msgid_store = MessageIdStore() for msgid, symbol in msgids.items(): msgid_store.add_msgid_and_symbol(msgid, symbol) diff --git a/tests/message/unittest_message.py b/tests/message/unittest_message.py index ef560a649..d0805e337 100644 --- a/tests/message/unittest_message.py +++ b/tests/message/unittest_message.py @@ -2,7 +2,9 @@ # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE # Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt -from typing import ValuesView +from __future__ import annotations + +from collections.abc import ValuesView from pylint.interfaces import HIGH from pylint.message import Message diff --git a/tests/message/unittest_message_id_store.py b/tests/message/unittest_message_id_store.py index 150ec8d69..69ff5f50b 100644 --- a/tests/message/unittest_message_id_store.py +++ b/tests/message/unittest_message_id_store.py @@ -2,8 +2,10 @@ # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE # Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt +from __future__ import annotations + +from collections.abc import ValuesView from pathlib import Path -from typing import Dict, ValuesView import pytest @@ -15,7 +17,7 @@ from pylint.message.message_id_store import MessageIdStore EMPTY_FILE = str(Path(__file__).parent.parent.resolve() / "regrtest_data" / "empty.py") -def test_len_str(msgid_store: MessageIdStore, msgids: Dict[str, str]) -> None: +def test_len_str(msgid_store: MessageIdStore, msgids: dict[str, str]) -> None: assert len(msgid_store) == len(msgids) str_result = str(msgid_store) assert "MessageIdStore: [" in str_result @@ -26,7 +28,7 @@ def test_len_str(msgid_store: MessageIdStore, msgids: Dict[str, str]) -> None: assert "]" in str_result -def test_get_message_ids(msgid_store: MessageIdStore, msgids: Dict[str, str]) -> None: +def test_get_message_ids(msgid_store: MessageIdStore, msgids: dict[str, str]) -> None: """We can get message id even with capitalization problem.""" msgid = list(msgids.keys())[0] msgids_result = msgid_store.get_active_msgids(msgid.lower()) |