mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-21 00:21:49 +00:00
test(streaming): satisfy PT012 for async EOF MidStreamFallbackError
This commit is contained in:
parent
9a2e9eb8da
commit
3a02837041
1 changed files with 5 additions and 1 deletions
|
|
@ -4915,10 +4915,14 @@ async def test_clean_eof_without_finish_reason_raises_midstream_error_issue_4026
|
|||
)
|
||||
|
||||
chunks = []
|
||||
with pytest.raises(MidStreamFallbackError) as excinfo:
|
||||
|
||||
async def _consume():
|
||||
async for c in wrapper:
|
||||
chunks.append(c)
|
||||
|
||||
with pytest.raises(MidStreamFallbackError) as excinfo:
|
||||
await _consume()
|
||||
|
||||
assert chunks, "partial content should have been yielded before the error"
|
||||
assert all(getattr(c.choices[0], "finish_reason", None) is None for c in chunks)
|
||||
assert wrapper.received_finish_reason is None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue