Skip to content

Commit d5e46c6

Browse files
committed
Removed -c to simulate a real file not found error instead of executing a bad inline script. This ensures the subprocess fails to launch, which better matches the test's intent.
1 parent 249d81e commit d5e46c6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/client/test_stdio.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ async def test_stdio_client():
5757
@pytest.mark.anyio
5858
async def test_stdio_client_bad_path():
5959
"""Check that the connection doesn't hang if process errors."""
60-
server_params = StdioServerParameters(command="python", args=["-c", "non-existent-file.py"])
60+
61+
# Removed `-c` to simulate a real "file not found" error instead of
62+
# executing a bad inline script.
63+
# This ensures the subprocess fails to launch, which better matches
64+
# the test's intent.
65+
server_params = StdioServerParameters(command="python", args=["non-existent-file.py"])
6166
async with stdio_client(server_params) as (read_stream, write_stream):
6267
async with ClientSession(read_stream, write_stream) as session:
6368
# The session should raise an error when the connection closes

0 commit comments

Comments
 (0)