Skip to content

Commit

Permalink
fix more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mdumandag committed Jul 4, 2024
1 parent 2007399 commit 982561a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions tests/asyncio/test_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ async def test_chat_custom_provider_streaming_async(async_qstash: AsyncQStash) -
if i == 0:
assert r.choices[0].delta.role is not None
else:
assert r.choices[0].delta.content is not None
assert (
r.choices[0].delta.content is not None
or r.choices[0].finish_reason is not None
)

i += 1

Expand Down Expand Up @@ -215,6 +218,9 @@ async def test_prompt_custom_provider_streaming_async(
if i == 0:
assert r.choices[0].delta.role is not None
else:
assert r.choices[0].delta.content is not None
assert (
r.choices[0].delta.content is not None
or r.choices[0].finish_reason is not None
)

i += 1
10 changes: 8 additions & 2 deletions tests/test_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ def test_chat_custom_provider_streaming(qstash: QStash) -> None:
if i == 0:
assert r.choices[0].delta.role is not None
else:
assert r.choices[0].delta.content is not None
assert (
r.choices[0].delta.content is not None
or r.choices[0].finish_reason is not None
)


def test_prompt_custom_provider(qstash: QStash) -> None:
Expand Down Expand Up @@ -181,4 +184,7 @@ def test_prompt_custom_provider_streaming(qstash: QStash) -> None:
if i == 0:
assert r.choices[0].delta.role is not None
else:
assert r.choices[0].delta.content is not None
assert (
r.choices[0].delta.content is not None
or r.choices[0].finish_reason is not None
)

0 comments on commit 982561a

Please sign in to comment.