Skip to content

Commit 816a042

Browse files
authored
test: fix another Responses flaky test (#10498)
* test: fix another Responses flaky test * improve
1 parent bddb815 commit 816a042

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/components/generators/chat/test_openai_responses.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,9 @@ def test_live_run_with_reasoning(self):
582582
results = component.run(chat_messages)
583583
assert len(results["replies"]) == 1
584584
message: ChatMessage = results["replies"][0]
585-
assert "Moon" in message.text
585+
assert message.reasoning is not None
586+
assert "moon" in message.text.lower() or "moon" in message.reasoning.reasoning_text.lower()
586587
assert "gpt-5-nano" in message.meta["model"]
587-
assert message.reasonings is not None
588588
assert message.meta["status"] == "completed"
589589
assert message.meta["usage"]["output_tokens"] > 0
590590
assert "reasoning_tokens" in message.meta["usage"]["output_tokens_details"]
@@ -697,7 +697,7 @@ def test_live_run_with_reasoning_and_streaming(self):
697697
assert len(results["replies"]) == 1
698698
message: ChatMessage = results["replies"][0]
699699
assert callback.reasoning == message.reasoning.reasoning_text
700-
assert "moon" in callback.content.lower()
700+
assert "moon" in callback.content.lower() or "moon" in callback.reasoning.lower()
701701
assert "gpt-5-nano" in message.meta["model"]
702702
assert message.reasonings is not None
703703
assert message.meta["status"] == "completed"

0 commit comments

Comments
 (0)