Skip to content

Commit 2ef65c1

Browse files
committed
tolerate stdio subprocess warnings
1 parent 30a61fd commit 2ef65c1

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

tests/interaction/transports/test_stdio.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ async def collect(params: LoggingMessageNotificationParams) -> None:
8989
[LoggingMessageNotificationParams(level="info", logger="echo", data="echoing across\nprocesses")]
9090
)
9191
# The server writes this line only after its run loop returns, which happens when stdin closes:
92-
# seeing it proves the process exited on its own rather than via the transport's terminate
93-
# escalation, without a timing-based assertion. The capture itself proves stderr passthrough:
94-
# the transport routes the child's stderr to the caller's `errlog` without consuming it.
95-
assert captured_stderr == snapshot("stdio-echo: clean exit\n")
92+
# seeing it as the final stderr line proves the process exited on its own rather than via the
93+
# transport's terminate escalation, without a timing-based assertion. The capture itself proves
94+
# stderr passthrough: the transport routes the child's stderr to the caller's `errlog` without
95+
# consuming it. Some lowest-direct dependency combinations can emit import-time warnings before
96+
# the server starts, so do not require this to be the only stderr line.
97+
assert captured_stderr.splitlines(keepends=True)[-1:] == snapshot(["stdio-echo: clean exit\n"])
9698

9799

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

0 commit comments

Comments
 (0)