Skip to content

Commit 7f78303

Browse files
authored
Fix typecheck failures in master (#2777)
* Add missing type hints to check_type_completeness * Test_windows is not currently typed
1 parent 4c53941 commit 7f78303

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ module = [
8686
"trio/_core/_tests/test_thread_cache",
8787
"trio/_core/_tests/test_tutil",
8888
"trio/_core/_tests/test_unbounded_queue",
89+
"trio/_core/_tests/test_windows",
8990
"trio/_core/_tests/tutil",
9091
"trio/_tests/pytest_plugin",
9192
"trio/_tests/test_abc",

trio/_tests/check_type_completeness.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@
66
import json
77
import subprocess
88
import sys
9+
from collections.abc import Mapping
910
from pathlib import Path
1011

1112
# the result file is not marked in MANIFEST.in so it's not included in the package
1213
failed = False
1314

1415

15-
def get_result_file_name(platform: str):
16+
def get_result_file_name(platform: str) -> Path:
1617
return Path(__file__).parent / f"verify_types_{platform.lower()}.json"
1718

1819

1920
# TODO: consider checking manually without `--ignoreexternal`, and/or
2021
# removing it from the below call later on.
21-
def run_pyright(platform: str):
22+
def run_pyright(platform: str) -> subprocess.CompletedProcess[bytes]:
2223
return subprocess.run(
2324
[
2425
"pyright",
@@ -33,7 +34,13 @@ def run_pyright(platform: str):
3334
)
3435

3536

36-
def check_less_than(key, current_dict, last_dict, /, invert=False):
37+
def check_less_than(
38+
key: str,
39+
current_dict: Mapping[str, float],
40+
last_dict: Mapping[str, float],
41+
/,
42+
invert: bool = False,
43+
) -> None:
3744
global failed
3845
current = current_dict[key]
3946
last = last_dict[key]
@@ -57,7 +64,7 @@ def check_less_than(key, current_dict, last_dict, /, invert=False):
5764
)
5865

5966

60-
def check_zero(key, current_dict):
67+
def check_zero(key: str, current_dict: Mapping[str, float]) -> None:
6168
global failed
6269
if current_dict[key] != 0:
6370
failed = True

0 commit comments

Comments
 (0)