Skip to content

Commit ecb9526

Browse files
fix tests
1 parent d48c85f commit ecb9526

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

tests/integrations/litellm/test_litellm.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ async def __call__(self, *args, **kwargs):
3939
import litellm.utils as litellm_utils
4040
from litellm.litellm_core_utils import streaming_handler
4141
from litellm.litellm_core_utils import thread_pool_executor
42+
from litellm.litellm_core_utils import litellm_logging
4243
from litellm.litellm_core_utils.logging_worker import GLOBAL_LOGGING_WORKER
43-
from litellm.llms.custom_httpx.http_handler import HTTPHandler
44+
from litellm.llms.custom_httpx.http_handler import HTTPHandler, AsyncHTTPHandler
4445

4546

4647
LITELLM_VERSION = package_version("litellm")
@@ -50,6 +51,7 @@ def _reset_litellm_executor():
5051
thread_pool_executor.executor = ThreadPoolExecutor(max_workers=100)
5152
litellm_utils.executor = thread_pool_executor.executor
5253
streaming_handler.executor = thread_pool_executor.executor
54+
litellm_logging.executor = thread_pool_executor.executor
5355

5456

5557
@pytest.fixture()
@@ -879,8 +881,6 @@ async def test_async_exception_handling(
879881
client=client,
880882
)
881883

882-
litellm_utils.executor.shutdown(wait=True)
883-
884884
# Should have error event and transaction
885885
assert len(events) >= 1
886886
# Find the error event
@@ -1067,7 +1067,7 @@ async def test_async_multiple_providers(
10671067

10681068
_reset_litellm_executor()
10691069

1070-
anthropic_client = HTTPHandler()
1070+
anthropic_client = AsyncHTTPHandler()
10711071
anthropic_model_response = get_model_response(
10721072
nonstreaming_anthropic_model_response,
10731073
serialize_pydantic=True,
@@ -1092,7 +1092,7 @@ async def test_async_multiple_providers(
10921092

10931093
_reset_litellm_executor()
10941094

1095-
gemini_client = HTTPHandler()
1095+
gemini_client = AsyncHTTPHandler()
10961096
gemini_model_response = get_model_response(
10971097
nonstreaming_google_genai_model_response,
10981098
serialize_pydantic=True,
@@ -1336,12 +1336,12 @@ async def test_async_no_integration(
13361336
events = capture_events()
13371337

13381338
messages = [{"role": "user", "content": "Hello!"}]
1339-
client = OpenAI(api_key="z")
1339+
client = AsyncOpenAI(api_key="z")
13401340

13411341
model_response = get_model_response(
13421342
nonstreaming_chat_completions_model_response,
13431343
serialize_pydantic=True,
1344-
request_headers={"X-Stainless-Raw-Response": "True"},
1344+
request_headers={"X-Stainless-Raw-Response": "true"},
13451345
)
13461346

13471347
with mock.patch.object(
@@ -1350,7 +1350,7 @@ async def test_async_no_integration(
13501350
return_value=model_response,
13511351
):
13521352
with start_transaction(name="litellm test"):
1353-
await litellm.completion(
1353+
await litellm.acompletion(
13541354
model="gpt-3.5-turbo",
13551355
messages=messages,
13561356
client=client,

0 commit comments

Comments
 (0)