diff options
author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-09-09 12:56:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-09 12:56:40 +0200 |
commit | 2b6bd64d43ed109b1ee15f0993c010660cf56b13 (patch) | |
tree | 0f8605ed4d6b2dc4d0d176a4761d6fdd6526eb4d /tests/checkers | |
parent | 6bac42efacdf1c1777db2021ca6ceda89eb8f199 (diff) | |
download | pylint-git-2b6bd64d43ed109b1ee15f0993c010660cf56b13.tar.gz |
Finish some incomplete typing signatures (#7442)
Diffstat (limited to 'tests/checkers')
-rw-r--r-- | tests/checkers/unittest_unicode/unittest_bad_chars.py | 4 | ||||
-rw-r--r-- | tests/checkers/unittest_unicode/unittest_functions.py | 18 |
2 files changed, 13 insertions, 9 deletions
diff --git a/tests/checkers/unittest_unicode/unittest_bad_chars.py b/tests/checkers/unittest_unicode/unittest_bad_chars.py index 08b4c9539..7746ce4ae 100644 --- a/tests/checkers/unittest_unicode/unittest_bad_chars.py +++ b/tests/checkers/unittest_unicode/unittest_bad_chars.py @@ -41,7 +41,9 @@ def bad_char_file_generator(tmp_path: Path) -> Callable[[str, bool, str], Path]: "# Invalid char esc: \x1B", ) - def _bad_char_file_generator(codec: str, add_invalid_bytes: bool, line_ending: str): + def _bad_char_file_generator( + codec: str, add_invalid_bytes: bool, line_ending: str + ) -> Path: byte_suffix = b"" if add_invalid_bytes: if codec == "utf-8": diff --git a/tests/checkers/unittest_unicode/unittest_functions.py b/tests/checkers/unittest_unicode/unittest_functions.py index c2fef9357..0c809ccdc 100644 --- a/tests/checkers/unittest_unicode/unittest_functions.py +++ b/tests/checkers/unittest_unicode/unittest_functions.py @@ -105,8 +105,10 @@ SEARCH_DICT_BYTE_UTF8 = { def test_map_positions_to_result( line: pylint.checkers.unicode._StrLike, expected: dict[int, pylint.checkers.unicode._BadChar], - search_dict, -): + search_dict: dict[ + pylint.checkers.unicode._StrLike, pylint.checkers.unicode._BadChar + ], +) -> None: """Test all possible outcomes for map position function in UTF-8 and ASCII.""" if isinstance(line, bytes): newline = b"\n" @@ -133,7 +135,7 @@ def test_map_positions_to_result( pytest.param(b"12345678\n\r", id="wrong_order_byte"), ], ) -def test_line_length(line: pylint.checkers.unicode._StrLike): +def test_line_length(line: pylint.checkers.unicode._StrLike) -> None: assert pylint.checkers.unicode._line_length(line, "utf-8") == 10 @@ -146,7 +148,7 @@ def test_line_length(line: pylint.checkers.unicode._StrLike): pytest.param("12345678\n\r", id="wrong_order"), ], ) -def test_line_length_utf16(line: str): +def test_line_length_utf16(line: str) -> None: assert pylint.checkers.unicode._line_length(line.encode("utf-16"), "utf-16") == 10 @@ -159,7 +161,7 @@ def test_line_length_utf16(line: str): pytest.param("12345678\n\r", id="wrong_order"), ], ) -def test_line_length_utf32(line: str): +def test_line_length_utf32(line: str) -> None: assert pylint.checkers.unicode._line_length(line.encode("utf-32"), "utf-32") == 10 @@ -186,7 +188,7 @@ def test_line_length_utf32(line: str): ("ASCII", "ascii"), ], ) -def test__normalize_codec_name(codec: str, expected: str): +def test__normalize_codec_name(codec: str, expected: str) -> None: assert pylint.checkers.unicode._normalize_codec_name(codec) == expected @@ -216,7 +218,7 @@ def test__normalize_codec_name(codec: str, expected: str): ) def test___fix_utf16_32_line_stream( tmp_path: Path, codec: str, line_ending: str, final_new_line: bool -): +) -> None: """Content of stream should be the same as should be the length.""" def decode_line(line: bytes, codec: str) -> str: @@ -260,5 +262,5 @@ def test___fix_utf16_32_line_stream( ("ascii", 1), ], ) -def test__byte_to_str_length(codec: str, expected: int): +def test__byte_to_str_length(codec: str, expected: int) -> None: assert pylint.checkers.unicode._byte_to_str_length(codec) == expected |