Skip to content

Commit 80146db

Browse files
committed
Typecheck tests
1 parent 6967d29 commit 80146db

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ idlemypyextension = ["py.typed"]
7171
package = true
7272

7373
[tool.mypy]
74-
files = ["src/idlemypyextension/",]
74+
files = ["src/idlemypyextension/", "tests"]
7575
mypy_path = "stubs"
7676
enable_error_code = ["truthy-bool", "mutable-override"]
7777
show_column_numbers = true

tests/test_annotate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
from idlemypyextension import annotate
1414

1515
if TYPE_CHECKING:
16-
from collections.abc import Collection, Sequence
16+
from collections.abc import Collection, Generator, Sequence
1717

1818

1919
@pytest.fixture(autouse=True)
20-
def mock_extension_log() -> MagicMock:
20+
def mock_extension_log() -> Generator[MagicMock, None, None]:
2121
"""Fixture to override extension_log with an empty function."""
2222
with patch(
2323
"idlemypyextension.utils.extension_log",

tests/test_tktrio.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212

1313
if TYPE_CHECKING:
1414
import tkinter as tk
15-
from collections.abc import Callable
15+
from collections.abc import Callable, Generator
1616

1717
from typing_extensions import TypeVarTuple, Unpack
1818

1919
PosArgT = TypeVarTuple("PosArgT")
2020

2121

2222
@pytest.fixture(autouse=True)
23-
def mock_extension_log() -> MagicMock:
23+
def mock_extension_log() -> Generator[MagicMock, None, None]:
2424
"""Fixture to override extension_log with an empty function."""
2525
with patch(
2626
"idlemypyextension.utils.extension_log",
@@ -116,7 +116,7 @@ def test_invalid_initialization() -> None:
116116
ValueError,
117117
match=r"^Must be subclass of both tk\.Misc and tk\.Wm$",
118118
):
119-
TkTrioRunner(None, None)
119+
TkTrioRunner(None, None) # type: ignore[arg-type]
120120

121121

122122
def test_schedule_task_not_threadsafe(trio_runner: TkTrioRunner) -> None:
@@ -149,7 +149,7 @@ async def test() -> None:
149149

150150
assert trio_runner.run_status == RunStatus.TRIO_RUNNING_CANCELED
151151

152-
while trio_runner.run_status != RunStatus.NO_TASK:
152+
while str(trio_runner.run_status) != str(RunStatus.NO_TASK):
153153
trio_runner.root.update()
154154

155155
assert nursery.cancel_scope.cancel_called

0 commit comments

Comments
 (0)