File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,17 +87,10 @@ async def test_stdio_server_does_not_close_real_stdio(monkeypatch: pytest.Monkey
8787 await write_stream .aclose ()
8888 await read_stream .aclose ()
8989
90- # os.fstat() raises OSError if the fd has been closed; success means the fd
91- # is still open. A plain `is not None` check would be vacuously true, so we
92- # use try/except to make the intent explicit.
93- try :
94- os .fstat (real_stdin_fd )
95- except OSError :
96- pytest .fail ("stdio_server() closed the real stdin file descriptor" )
97- try :
98- os .fstat (real_stdout_fd )
99- except OSError :
100- pytest .fail ("stdio_server() closed the real stdout file descriptor" )
90+ # os.fstat() raises OSError if the fd has been closed; successful calls
91+ # prove stdio_server() did not close the real process descriptors.
92+ os .fstat (real_stdin_fd )
93+ os .fstat (real_stdout_fd )
10194 # The Python wrappers we set as sys.stdin/stdout must not be closed either.
10295 assert not sys .stdin .closed
10396 assert not sys .stdout .closed
You can’t perform that action at this time.
0 commit comments