File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -194,9 +194,12 @@ async def mock_connection(
194194 loop : asyncio .AbstractEventLoop ,
195195 protocol_factory : Callable [[], pw_receiver .StickReceiver ], # type: ignore[name-defined]
196196 ** kwargs : dict [str , Any ],
197- ) -> tuple [DummyTransport , pw_receiver .StickReceiver ]: # type: ignore[name-defined]
197+ ) -> tuple [DummyTransport , pw_receiver .StickReceiver ] | None : # type: ignore[name-defined]
198198 """Mock connection with dummy connection."""
199199 self ._protocol = protocol_factory ()
200+ if self ._protocol is None :
201+ return None
202+
200203 self ._transport = DummyTransport (loop , self .custom_response )
201204 self ._transport .protocol_data_received = self ._protocol .data_received
202205 loop .call_soon_threadsafe (self ._protocol .connection_made , self ._transport )
You can’t perform that action at this time.
0 commit comments