Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into polish-suppress-in-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davorrunje committed Jan 28, 2025
2 parents 03e0372 + 267ce37 commit f516592
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion test/agentchat/test_conversable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))

Expand Down Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion test/agentchat/test_groupchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -479,3 +480,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)

0 comments on commit f516592

Please sign in to comment.