From b92f1af301fd9af46e398bb6f9eea76d90b909b8 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Thu, 7 Dec 2023 14:20:14 -0800 Subject: [PATCH] test: cleaning up local testing --- litellm/tests/test_proxy_server_caching.py | 64 +++++++++++----------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/litellm/tests/test_proxy_server_caching.py b/litellm/tests/test_proxy_server_caching.py index a62b08e31aa..75b017e50ef 100644 --- a/litellm/tests/test_proxy_server_caching.py +++ b/litellm/tests/test_proxy_server_caching.py @@ -1,38 +1,38 @@ -#### What this tests #### -# This tests using caching w/ litellm which requires SSL=True +# #### What this tests #### +# # This tests using caching w/ litellm which requires SSL=True -import sys, os -import time -import traceback -from dotenv import load_dotenv +# import sys, os +# import time +# import traceback +# from dotenv import load_dotenv -load_dotenv() -import os +# load_dotenv() +# import os -sys.path.insert( - 0, os.path.abspath("../..") -) # Adds the parent directory to the system path -import pytest -import litellm -from litellm import embedding, completion -from litellm.caching import Cache +# sys.path.insert( +# 0, os.path.abspath("../..") +# ) # Adds the parent directory to the system path +# import pytest +# import litellm +# from litellm import embedding, completion +# from litellm.caching import Cache -messages = [{"role": "user", "content": f"who is ishaan {time.time()}"}] +# messages = [{"role": "user", "content": f"who is ishaan {time.time()}"}] -@pytest.mark.skip(reason="local proxy test") -def test_caching_v2(): # test in memory cache - try: - response1 = completion(model="openai/gpt-3.5-turbo", messages=messages, api_base="http://0.0.0.0:8000") - response2 = completion(model="openai/gpt-3.5-turbo", messages=messages, api_base="http://0.0.0.0:8000") - print(f"response1: {response1}") - print(f"response2: {response2}") - litellm.cache = None # disable cache - if response2['choices'][0]['message']['content'] != response1['choices'][0]['message']['content']: - print(f"response1: {response1}") - print(f"response2: {response2}") - raise Exception() - except Exception as e: - print(f"error occurred: {traceback.format_exc()}") - pytest.fail(f"Error occurred: {e}") +# @pytest.mark.skip(reason="local proxy test") +# def test_caching_v2(): # test in memory cache +# try: +# response1 = completion(model="openai/gpt-3.5-turbo", messages=messages, api_base="http://0.0.0.0:8000") +# response2 = completion(model="openai/gpt-3.5-turbo", messages=messages, api_base="http://0.0.0.0:8000") +# print(f"response1: {response1}") +# print(f"response2: {response2}") +# litellm.cache = None # disable cache +# if response2['choices'][0]['message']['content'] != response1['choices'][0]['message']['content']: +# print(f"response1: {response1}") +# print(f"response2: {response2}") +# raise Exception() +# except Exception as e: +# print(f"error occurred: {traceback.format_exc()}") +# pytest.fail(f"Error occurred: {e}") -test_caching_v2() \ No newline at end of file +# test_caching_v2() \ No newline at end of file