Skip to content

Commit 8a3eac7

Browse files
committed
Fix pylint warnings
1 parent df68266 commit 8a3eac7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_usb.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)