Skip to content

Commit a29936c

Browse files
committed
tolerate stdio subprocess warnings
1 parent 67e7276 commit a29936c

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tests/interaction/transports/test_stdio.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,13 @@ async def collect(params: LoggingMessageNotificationParams) -> None:
9898
assert received == snapshot(
9999
[LoggingMessageNotificationParams(level="info", logger="echo", data="echoing across\nprocesses")]
100100
)
101-
# The server writes this line only after its run loop returns on stdin close: seeing it proves
102-
# a self-exit, not the terminate escalation. The capture itself proves stderr passthrough.
103-
assert captured_stderr == snapshot("stdio-echo: clean exit\n")
101+
# The server writes this line only after its run loop returns, which happens when stdin closes:
102+
# seeing it as the final stderr line proves the process exited on its own rather than via the
103+
# transport's terminate escalation, without a timing-based assertion. The capture itself proves
104+
# stderr passthrough: the transport routes the child's stderr to the caller's `errlog` without
105+
# consuming it. Some lowest-direct dependency combinations can emit import-time warnings before
106+
# the server starts, so do not require this to be the only stderr line.
107+
assert captured_stderr.splitlines(keepends=True)[-1:] == snapshot(["stdio-echo: clean exit\n"])
104108

105109

106110
@requirement("transport:stdio:stream-purity")

0 commit comments

Comments
 (0)