Skip to content

Commit 236ef8f

Browse files
committed
test(snapshot): Add type annotation to mock_filter function
why: To improve type safety and help mypy with type checking in tests. what: - Add proper type annotation to the mock_filter function in test_snapshot_active_only - Explicitly specify that the function accepts snapshot types (ServerSnapshot, SessionSnapshot, WindowSnapshot, PaneSnapshot) - Return type was already correctly annotated as bool
1 parent e71a50f commit 236ef8f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_snapshot.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,9 @@ def test_snapshot_active_only() -> None:
287287
mock_server_snap.sessions_snapshot = [mock_session_snap]
288288

289289
# Create mock filter function that passes everything through
290-
def mock_filter(snapshot) -> bool:
290+
def mock_filter(
291+
snapshot: ServerSnapshot | SessionSnapshot | WindowSnapshot | PaneSnapshot,
292+
) -> bool:
291293
return True
292294

293295
# Apply the filter with a patch to avoid actual implementation

0 commit comments

Comments
 (0)