File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 1+ import errno
12import os
23import shutil
34import sys
@@ -90,17 +91,12 @@ async def test_stdio_client_nonexistent_command():
9091 )
9192
9293 # Should raise an error when trying to start the process
93- with pytest .raises (Exception ) as exc_info :
94+ with pytest .raises (OSError ) as exc_info :
9495 async with stdio_client (server_params ) as (_ , _ ):
9596 pass
9697
97- # The error should indicate the command was not found
98- error_message = str (exc_info .value )
99- assert (
100- "nonexistent" in error_message
101- or "not found" in error_message .lower ()
102- or "cannot find the file" in error_message .lower () # Windows error message
103- )
98+ # The error should indicate the command was not found (ENOENT: No such file or directory)
99+ assert exc_info .value .errno == errno .ENOENT
104100
105101
106102@pytest .mark .anyio
You can’t perform that action at this time.
0 commit comments