Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions tests/client/test_stdio.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import errno
import os
import shutil
import sys
Expand Down Expand Up @@ -90,17 +91,12 @@ async def test_stdio_client_nonexistent_command():
)

# Should raise an error when trying to start the process
with pytest.raises(Exception) as exc_info:
with pytest.raises(OSError) as exc_info:
async with stdio_client(server_params) as (_, _):
pass

# The error should indicate the command was not found
error_message = str(exc_info.value)
assert (
"nonexistent" in error_message
or "not found" in error_message.lower()
or "cannot find the file" in error_message.lower() # Windows error message
)
# The error should indicate the command was not found (ENOENT: No such file or directory)
assert exc_info.value.errno == errno.ENOENT


@pytest.mark.anyio
Expand Down
Loading