Skip to content

Commit f963580

Browse files
committed
test: add comprehensive tests for Jupyter stderr support
- Test Jupyter environment detection (with/without IPython) - Test stderr printing in Jupyter and non-Jupyter environments - Test IPython display fallback when display fails - Test stderr capture and piping - Test stderr reader exception handling - Test empty line filtering and final buffer handling - Test process without stderr stream Achieves 100% code coverage for the new functionality.
1 parent 69ff03b commit f963580

File tree

2 files changed

+443
-2
lines changed

2 files changed

+443
-2
lines changed

src/mcp/client/stdio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def _is_jupyter_notebook() -> bool:
6060
from IPython import get_ipython # type: ignore[import-not-found]
6161

6262
ipython = get_ipython() # type: ignore[no-untyped-call]
63-
return ipython is not None and ipython.__class__.__name__ in ("ZMQInteractiveShell", "TerminalInteractiveShell")
63+
return ipython is not None and ipython.__class__.__name__ in ("ZMQInteractiveShell", "TerminalInteractiveShell") # type: ignore[union-attr]
6464
except ImportError:
6565
return False
6666

0 commit comments

Comments
 (0)