MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / test_receive_output_logs_exception

Function test_receive_output_logs_exception

tests/entrypoints/test_llm.py:139–152  ·  view source on GitHub ↗
(caplog)

Source from the content-addressed store, hash-verified

137
138
139def test_receive_output_logs_exception(caplog):
140 llm = _make_llm(_make_engine())
141 calls = iter([RuntimeError("boom"), SystemExit()])
142
143 def _get_generated_result():
144 nxt = next(calls)
145 if isinstance(nxt, BaseException):
146 raise nxt
147 return nxt
148
149 llm.llm_engine._get_generated_result = _get_generated_result
150 with pytest.raises(SystemExit):
151 llm._receive_output()
152 assert "Unexcepted error happened" in caplog.text
153
154
155def test_generate_and_chat_branches():

Callers

nothing calls this directly

Calls 3

_make_llmFunction · 0.85
_make_engineFunction · 0.85
_receive_outputMethod · 0.80

Tested by

no test coverage detected