Skip to content

Commit 4e6bda4

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 4e6bda4

File tree

2 files changed

+570
-2
lines changed

2 files changed

+570
-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
fromIPythonimportget_ipython# type: ignore[import-not-found]
6161

6262
ipython=get_ipython() # type: ignore[no-untyped-call]
63-
returnipythonisnotNoneandipython.__class__.__name__in ("ZMQInteractiveShell", "TerminalInteractiveShell")
63+
returnipythonisnotNoneandipython.__class__.__name__in ("ZMQInteractiveShell", "TerminalInteractiveShell")# type: ignore[union-attr]
6464
exceptImportError:
6565
returnFalse
6666

0 commit comments

Comments
(0)