From 4aa6a2350a16e17d3da95b0dada5cad0ce5da91c Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Mon, 17 Jun 2024 19:22:33 -0700 Subject: [PATCH] test: skip watsonx tests - account closed --- litellm/tests/test_completion.py | 25 ++++++++++++++++++------- litellm/tests/test_streaming.py | 24 +++++++++++++++--------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index 0e1b4a9f41..0cb1f7929f 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -1,20 +1,25 @@ -import sys, os, json +import json +import os +import sys import traceback + from dotenv import load_dotenv load_dotenv() -import os, io +import io +import os sys.path.insert( 0, os.path.abspath("../..") ) # Adds the parent directory to the system path +from unittest.mock import MagicMock, patch + import pytest + import litellm -from litellm import embedding, completion, completion_cost, Timeout -from litellm import RateLimitError +from litellm import RateLimitError, Timeout, completion, completion_cost, embedding +from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler from litellm.llms.prompt_templates.factory import anthropic_messages_pt -from unittest.mock import patch, MagicMock -from litellm.llms.custom_httpx.http_handler import HTTPHandler, AsyncHTTPHandler # litellm.num_retries =3 litellm.cache = None @@ -1500,7 +1505,9 @@ def test_ollama_image(): data is untouched. """ - import io, base64 + import base64 + import io + from PIL import Image def mock_post(url, **kwargs): @@ -3478,6 +3485,7 @@ def test_completion_palm_stream(): pytest.fail(f"Error occurred: {e}") +@pytest.mark.skip(reason="IBM closed account.") def test_completion_watsonx(): litellm.set_verbose = True model_name = "watsonx/ibm/granite-13b-chat-v2" @@ -3498,6 +3506,7 @@ def test_completion_watsonx(): pytest.fail(f"Error occurred: {e}") +@pytest.mark.skip(reason="IBM closed account.") def test_completion_stream_watsonx(): litellm.set_verbose = True model_name = "watsonx/ibm/granite-13b-chat-v2" @@ -3565,6 +3574,7 @@ def test_unified_auth_params(provider, model, project, region_name, token): assert value in translated_optional_params +@pytest.mark.skip(reason="IBM closed account.") @pytest.mark.asyncio async def test_acompletion_watsonx(): litellm.set_verbose = True @@ -3585,6 +3595,7 @@ async def test_acompletion_watsonx(): pytest.fail(f"Error occurred: {e}") +@pytest.mark.skip(reason="IBM closed account.") @pytest.mark.asyncio async def test_acompletion_stream_watsonx(): litellm.set_verbose = True diff --git a/litellm/tests/test_streaming.py b/litellm/tests/test_streaming.py index 622b2efc84..1c402faa52 100644 --- a/litellm/tests/test_streaming.py +++ b/litellm/tests/test_streaming.py @@ -1,12 +1,17 @@ #### What this tests #### # This tests streaming for the completion endpoint -import sys, os, asyncio +import asyncio +import os +import sys +import time import traceback -import time, pytest, uuid -from pydantic import BaseModel +import uuid from typing import Tuple +import pytest +from pydantic import BaseModel + sys.path.insert( 0, os.path.abspath("../..") ) # Adds the parent directory to the system path @@ -15,12 +20,12 @@ from dotenv import load_dotenv load_dotenv() import litellm from litellm import ( - completion, - acompletion, AuthenticationError, BadRequestError, - RateLimitError, ModelResponse, + RateLimitError, + acompletion, + completion, ) litellm.logging = False @@ -1644,9 +1649,8 @@ def test_sagemaker_weird_response(): When the stream ends, flush any remaining holding chunks. """ try: - from litellm.llms.sagemaker import TokenIterator - import json import json + from litellm.llms.sagemaker import TokenIterator chunk = """[INST] Hey, how's it going? [/INST], @@ -1772,6 +1776,7 @@ def test_completion_sagemaker_stream(): pytest.fail(f"Error occurred: {e}") +@pytest.mark.skip(reason="IBM closed account.") def test_completion_watsonx_stream(): litellm.set_verbose = True try: @@ -2631,9 +2636,10 @@ def test_success_callback_streaming(): # test_success_callback_streaming() +from typing import List, Optional + #### STREAMING + FUNCTION CALLING ### from pydantic import BaseModel -from typing import List, Optional class Function(BaseModel):