Skip to content

Commit 9c1ebbc

Browse files
HandshakeType should be required if it is required
1 parent 8dedccd commit 9c1ebbc

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

replit_river/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(
2525
client_id: str,
2626
server_id: str,
2727
transport_options: TransportOptions,
28-
handshake_metadata: Optional[HandshakeType] = None,
28+
handshake_metadata: HandshakeType,
2929
) -> None:
3030
self._client_id = client_id
3131
self._server_id = server_id

replit_river/client_transport.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(
5151
client_id: str,
5252
server_id: str,
5353
transport_options: TransportOptions,
54-
handshake_metadata: Optional[HandshakeType] = None,
54+
handshake_metadata: HandshakeType,
5555
):
5656
super().__init__(
5757
transport_id=client_id,
@@ -276,7 +276,7 @@ async def _establish_handshake(
276276
transport_id: str,
277277
to_id: str,
278278
session_id: str,
279-
handshake_metadata: Optional[HandshakeType],
279+
handshake_metadata: HandshakeType,
280280
websocket: WebSocketCommonProtocol,
281281
old_session: Optional[ClientSession],
282282
) -> Tuple[

tests/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22
import logging
33
from collections.abc import AsyncIterator
4-
from typing import Any, AsyncGenerator, NoReturn
4+
from typing import Any, AsyncGenerator, Literal
55

66
import nanoid # type: ignore
77
import pytest
@@ -139,11 +139,12 @@ async def client(
139139
) -> AsyncGenerator[Client, None]:
140140
try:
141141
async with serve(server.serve, "localhost", 8765):
142-
client: Client[NoReturn] = Client(
142+
client: Client[Literal[None]] = Client(
143143
"ws://localhost:8765",
144144
client_id="test_client",
145145
server_id="test_server",
146146
transport_options=transport_options,
147+
handshake_metadata=None,
147148
)
148149
try:
149150
yield client

0 commit comments

Comments
 (0)