Skip to content

Commit e7d170f

Browse files
authored
Remove failing test. No need to have it here since it's already tested in haystack main. (#1842)
1 parent 819c78a commit e7d170f

File tree

4 files changed

+0
-115
lines changed

4 files changed

+0
-115
lines changed

integrations/meta_llama/tests/test_llama_chat_generator.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -239,36 +239,6 @@ def test_run_with_params(self, chat_messages, mock_chat_completion, monkeypatch)
239239
assert len(response["replies"]) == 1
240240
assert [isinstance(reply, ChatMessage) for reply in response["replies"]]
241241

242-
def test_check_abnormal_completions(self, caplog):
243-
component = MetaLlamaChatGenerator(api_key=Secret.from_token("test-api-key"))
244-
messages = [
245-
ChatMessage.from_assistant(
246-
"",
247-
meta={
248-
"finish_reason": "content_filter" if i % 2 == 0 else "length",
249-
"index": i,
250-
},
251-
)
252-
for i, _ in enumerate(range(4))
253-
]
254-
255-
for m in messages:
256-
component._check_finish_reason(m.meta)
257-
258-
# check truncation warning
259-
message_template = (
260-
"The completion for index {index} has been truncated before reaching a natural stopping point. "
261-
"Increase the max_tokens parameter to allow for longer completions."
262-
)
263-
264-
for index in [1, 3]:
265-
assert caplog.records[index].message == message_template.format(index=index)
266-
267-
# check content filter warning
268-
message_template = "The completion for index {index} has been truncated due to the content filter."
269-
for index in [0, 2]:
270-
assert caplog.records[index].message == message_template.format(index=index)
271-
272242
@pytest.mark.skipif(
273243
not os.environ.get("LLAMA_API_KEY", None),
274244
reason="Export an env var called LLAMA_API_KEY containing the OpenAI API key to run this test.",

integrations/mistral/tests/test_mistral_chat_generator.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -208,32 +208,6 @@ def test_run_with_params(self, chat_messages, mock_chat_completion, monkeypatch)
208208
assert len(response["replies"]) == 1
209209
assert [isinstance(reply, ChatMessage) for reply in response["replies"]]
210210

211-
def test_check_abnormal_completions(self, caplog):
212-
component = MistralChatGenerator(api_key=Secret.from_token("test-api-key"))
213-
messages = [
214-
ChatMessage.from_assistant(
215-
"", meta={"finish_reason": "content_filter" if i % 2 == 0 else "length", "index": i}
216-
)
217-
for i, _ in enumerate(range(4))
218-
]
219-
220-
for m in messages:
221-
component._check_finish_reason(m.meta)
222-
223-
# check truncation warning
224-
message_template = (
225-
"The completion for index {index} has been truncated before reaching a natural stopping point. "
226-
"Increase the max_tokens parameter to allow for longer completions."
227-
)
228-
229-
for index in [1, 3]:
230-
assert caplog.records[index].message == message_template.format(index=index)
231-
232-
# check content filter warning
233-
message_template = "The completion for index {index} has been truncated due to the content filter."
234-
for index in [0, 2]:
235-
assert caplog.records[index].message == message_template.format(index=index)
236-
237211
@pytest.mark.skipif(
238212
not os.environ.get("MISTRAL_API_KEY", None),
239213
reason="Export an env var called MISTRAL_API_KEY containing the OpenAI API key to run this test.",

integrations/openrouter/tests/test_openrouter_chat_generator.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -240,32 +240,6 @@ def test_run_with_params(self, chat_messages, mock_chat_completion, monkeypatch)
240240
assert len(response["replies"]) == 1
241241
assert [isinstance(reply, ChatMessage) for reply in response["replies"]]
242242

243-
def test_check_abnormal_completions(self, caplog):
244-
component = OpenRouterChatGenerator(api_key=Secret.from_token("test-api-key"))
245-
messages = [
246-
ChatMessage.from_assistant(
247-
"", meta={"finish_reason": "content_filter" if i % 2 == 0 else "length", "index": i}
248-
)
249-
for i, _ in enumerate(range(4))
250-
]
251-
252-
for m in messages:
253-
component._check_finish_reason(m.meta)
254-
255-
# check truncation warning
256-
message_template = (
257-
"The completion for index {index} has been truncated before reaching a natural stopping point. "
258-
"Increase the max_tokens parameter to allow for longer completions."
259-
)
260-
261-
for index in [1, 3]:
262-
assert caplog.records[index].message == message_template.format(index=index)
263-
264-
# check content filter warning
265-
message_template = "The completion for index {index} has been truncated due to the content filter."
266-
for index in [0, 2]:
267-
assert caplog.records[index].message == message_template.format(index=index)
268-
269243
@pytest.mark.skipif(
270244
not os.environ.get("OPENROUTER_API_KEY", None),
271245
reason="Export an env var called OPENROUTER_API_KEY containing the OpenRouter API key to run this test.",

integrations/stackit/tests/test_stackit_chat_generator.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -199,39 +199,6 @@ def test_run_with_params(self, chat_messages, mock_chat_completion, monkeypatch)
199199
assert len(response["replies"]) == 1
200200
assert [isinstance(reply, ChatMessage) for reply in response["replies"]]
201201

202-
def test_check_abnormal_completions(self, caplog):
203-
component = STACKITChatGenerator(
204-
model="neuralmagic/Meta-Llama-3.1-8B-Instruct-FP8", api_key=Secret.from_token("test-api-key")
205-
)
206-
messages = [
207-
ChatMessage.from_assistant(
208-
"", meta={"finish_reason": "content_filter" if i % 2 == 0 else "length", "index": i}
209-
)
210-
for i, _ in enumerate(range(4))
211-
]
212-
213-
for m in messages:
214-
try:
215-
# Haystack >= 2.9.0
216-
component._check_finish_reason(m.meta)
217-
except AttributeError:
218-
# Haystack < 2.9.0
219-
component._check_finish_reason(m)
220-
221-
# check truncation warning
222-
message_template = (
223-
"The completion for index {index} has been truncated before reaching a natural stopping point. "
224-
"Increase the max_tokens parameter to allow for longer completions."
225-
)
226-
227-
for index in [1, 3]:
228-
assert caplog.records[index].message == message_template.format(index=index)
229-
230-
# check content filter warning
231-
message_template = "The completion for index {index} has been truncated due to the content filter."
232-
for index in [0, 2]:
233-
assert caplog.records[index].message == message_template.format(index=index)
234-
235202
@pytest.mark.skipif(
236203
not os.environ.get("STACKIT_API_KEY", None),
237204
reason="Export an env var called STACKIT_API_KEY containing the API key to run this test.",

0 commit comments

Comments
 (0)