From 101cc53b1e4a6b9e7cb9566ed9f28f378cf892c4 Mon Sep 17 00:00:00 2001 From: rjambrecic <32619626+rjambrecic@users.noreply.github.com> Date: Tue, 28 Jan 2025 14:30:25 +0100 Subject: [PATCH] Supress failing deepseek-reasoner tests (#679) * Add suppress_json_decoder_error to deepseek-reasoner tests * Cleanup --- test/agentchat/test_conversable_agent.py | 8 +++++++- test/agentchat/test_groupchat.py | 3 ++- test/conftest.py | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/test/agentchat/test_conversable_agent.py b/test/agentchat/test_conversable_agent.py index 0bfaa778cf..c3e3a654cb 100755 --- a/test/agentchat/test_conversable_agent.py +++ b/test/agentchat/test_conversable_agent.py @@ -23,7 +23,12 @@ from autogen.agentchat.conversable_agent import register_function from autogen.exception_utils import InvalidCarryOverType, SenderRequired -from ..conftest import Credentials, credentials_all_llms, suppress_gemini_resource_exhausted +from ..conftest import ( + Credentials, + credentials_all_llms, + suppress_gemini_resource_exhausted, + suppress_json_decoder_error, +) here = os.path.abspath(os.path.dirname(__file__)) @@ -1614,6 +1619,7 @@ def login( @pytest.mark.deepseek +@suppress_json_decoder_error def test_conversable_agent_with_deepseek_reasoner( credentials_deepseek_reasoner: Credentials, ) -> None: diff --git a/test/agentchat/test_groupchat.py b/test/agentchat/test_groupchat.py index 599a10cbde..5346e19e8e 100755 --- a/test/agentchat/test_groupchat.py +++ b/test/agentchat/test_groupchat.py @@ -22,7 +22,7 @@ from autogen.agentchat.contrib.capabilities import transform_messages, transforms from autogen.exception_utils import AgentNameConflict, UndefinedNextAgent -from ..conftest import Credentials +from ..conftest import Credentials, suppress_json_decoder_error def test_func_call_groupchat(): @@ -2183,6 +2183,7 @@ def test_manager_resume_message_assignment(): @pytest.mark.deepseek +@suppress_json_decoder_error def test_groupchat_with_deepseek_reasoner( credentials_gpt_4o_mini: Credentials, credentials_deepseek_reasoner: Credentials, diff --git a/test/conftest.py b/test/conftest.py index 8da25f7c23..edde026bdf 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -10,6 +10,7 @@ import os import re import time +from json.decoder import JSONDecodeError from pathlib import Path from typing import Any, Callable, Optional, TypeVar @@ -493,3 +494,7 @@ def suppress_gemini_resource_exhausted(func: T) -> T: return suppress(ResourceExhausted, retries=2)(func) return func + + +def suppress_json_decoder_error(func: T) -> T: + return suppress(JSONDecodeError)(func)