Skip to content

Commit b48ab23

Browse files
author
ochafik
committed
Update test_chat_completion.py
1 parent 668fc90 commit b48ab23

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

examples/server/tests/unit/test_chat_completion.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,11 @@ def test_chat_completion_with_timings_per_token():
242242
"stream": True,
243243
"timings_per_token": True,
244244
})
245-
found_timings = False
246245
for data in res:
247-
if "timings" in data:
248-
found_timings = True
249-
assert "prompt_per_second" in data["timings"]
250-
assert "predicted_per_second" in data["timings"]
251-
assert "predicted_n" in data["timings"]
252-
assert data["timings"]["predicted_n"] <= 10
253-
254-
assert found_timings, "Expected timings in response chunks"
246+
assert "prompt_per_second" in data["timings"]
247+
assert "predicted_per_second" in data["timings"]
248+
assert "predicted_n" in data["timings"]
249+
assert data["timings"]["predicted_n"] <= 10
255250

256251

257252
def test_logprobs():

0 commit comments

Comments
 (0)