Skip to content

Commit 1b34f2e

Browse files
committed
Use pragma: no branch for Protocol stubs to satisfy strict-no-cover
1 parent 2513380 commit 1b34f2e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/mcp/client/_transport.py

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

1616

1717
@runtime_checkable
18-
class ReadStream(Protocol[T_co]): # pragma: no cover
18+
class ReadStream(Protocol[T_co]): # pragma: no branch
1919
"""Protocol for reading items from a stream.
2020
2121
Both ``MemoryObjectReceiveStream`` and ``ContextReceiveStream`` satisfy
2222
this protocol. Consumers that need the sender's context should use
2323
``getattr(stream, 'last_context', None)``.
2424
"""
2525

26-
async def receive(self) -> T_co: ...
27-
async def aclose(self) -> None: ...
28-
def __aiter__(self) -> ReadStream[T_co]: ...
29-
async def __anext__(self) -> T_co: ...
30-
async def __aenter__(self) -> Self: ...
31-
async def __aexit__(
26+
async def receive(self) -> T_co: ... # pragma: no branch
27+
async def aclose(self) -> None: ... # pragma: no branch
28+
def __aiter__(self) -> ReadStream[T_co]: ... # pragma: no branch
29+
async def __anext__(self) -> T_co: ... # pragma: no branch
30+
async def __aenter__(self) -> Self: ... # pragma: no branch
31+
async def __aexit__( # pragma: no branch
3232
self,
3333
exc_type: type[BaseException] | None,
3434
exc_val: BaseException | None,
@@ -37,17 +37,17 @@ async def __aexit__(
3737

3838

3939
@runtime_checkable
40-
class WriteStream(Protocol[T_contra]): # pragma: no cover
40+
class WriteStream(Protocol[T_contra]): # pragma: no branch
4141
"""Protocol for writing items to a stream.
4242
4343
Both ``MemoryObjectSendStream`` and ``ContextSendStream`` satisfy
4444
this protocol.
4545
"""
4646

47-
async def send(self, item: T_contra, /) -> None: ...
48-
async def aclose(self) -> None: ...
49-
async def __aenter__(self) -> Self: ...
50-
async def __aexit__(
47+
async def send(self, item: T_contra, /) -> None: ... # pragma: no branch
48+
async def aclose(self) -> None: ... # pragma: no branch
49+
async def __aenter__(self) -> Self: ... # pragma: no branch
50+
async def __aexit__( # pragma: no branch
5151
self,
5252
exc_type: type[BaseException] | None,
5353
exc_val: BaseException | None,

0 commit comments

Comments
 (0)