File tree Expand file tree Collapse file tree
tests/interaction/transports Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import sys
1010import tempfile
1111from pathlib import Path
12+ from typing import TextIO , cast
1213
1314import anyio
1415import pytest
@@ -62,7 +63,7 @@ async def collect(params: LoggingMessageNotificationParams) -> None:
6263 env = {key : value for key , value in os .environ .items () if key .startswith ("COVERAGE_" )}
6364 | {"PYTHONWARNINGS" : "ignore::SyntaxWarning" },
6465 ),
65- errlog = errlog ,
66+ errlog = cast ( TextIO , errlog ) ,
6667 )
6768
6869 # Must exceed session time plus the patched PROCESS_TERMINATION_TIMEOUT (20s).
@@ -80,8 +81,12 @@ async def collect(params: LoggingMessageNotificationParams) -> None:
8081 assert received == snapshot (
8182 [LoggingMessageNotificationParams (level = "info" , logger = "echo" , data = "echoing across\n processes" )]
8283 )
83- # The marker distinguishes clean exit from termination.
84- assert captured_stderr == snapshot ("stdio-echo: clean exit\n " )
84+ # The server writes this line only after its run loop returns, which happens when stdin closes:
85+ # seeing it proves the process exited on its own rather than via the transport's terminate
86+ # escalation, without a timing-based assertion. The capture itself proves stderr passthrough:
87+ # the transport routes the child's stderr to the caller's `errlog` without consuming it.
88+ # Prerelease Python/lowest-direct dependency runs may print warnings before the server marker.
89+ assert captured_stderr .endswith ("stdio-echo: clean exit\n " )
8590
8691
8792@requirement ("transport:stdio:stream-purity" )
You can’t perform that action at this time.
0 commit comments