File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -37,15 +37,15 @@ def _is_jupyter_environment() -> bool:
3737 """
3838 try :
3939 # Check for IPython kernel
40- from IPython import get_ipython
40+ from IPython import get_ipython # type: ignore[reportMissingImports]
4141
42- ipython = get_ipython ()
42+ ipython = get_ipython () # type: ignore[reportUnknownVariableType]
4343 if ipython is not None :
4444 # Check if it's a notebook kernel (not just IPython terminal)
45- if "IPKernelApp" in ipython .config :
45+ if "IPKernelApp" in ipython .config : # type: ignore[reportUnknownMemberType]
4646 return True
4747 # Also check for ZMQInteractiveShell which indicates notebook
48- if ipython .__class__ .__name__ == "ZMQInteractiveShell" :
48+ if ipython .__class__ .__name__ == "ZMQInteractiveShell" : # type: ignore[reportUnknownMemberType]
4949 return True
5050 except (ImportError , AttributeError ):
5151 pass
Original file line number Diff line number Diff line change @@ -769,7 +769,10 @@ async def test_stderr_reader_jupyter_mode(self):
769769 # Mock _is_jupyter_environment to return True to exercise stderr_reader
770770 with patch ("mcp.client.stdio._is_jupyter_environment" , return_value = True ):
771771 with anyio .move_on_after (5.0 ) as cancel_scope :
772- async with stdio_client (server_params ) as (read_stream , write_stream ):
772+ async with stdio_client (server_params ) as ( # pragma: no branch
773+ read_stream ,
774+ write_stream ,
775+ ):
773776 await anyio .sleep (1.0 )
774777
775778 assert not cancel_scope .cancelled_caught , "stdio_client should not hang in Jupyter mode"
@@ -798,7 +801,10 @@ async def test_stderr_reader_jupyter_mode_continuous(self):
798801
799802 with patch ("mcp.client.stdio._is_jupyter_environment" , return_value = True ):
800803 with anyio .move_on_after (5.0 ) as cancel_scope :
801- async with stdio_client (server_params ) as (read_stream , write_stream ):
804+ async with stdio_client (server_params ) as ( # pragma: no branch
805+ read_stream ,
806+ write_stream ,
807+ ):
802808 await anyio .sleep (1.0 )
803809
804810 assert not cancel_scope .cancelled_caught , "stdio_client should handle continuous Jupyter stderr"
You can’t perform that action at this time.
0 commit comments