From 62aab9118659893309961878617c1126a6387b49 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 19 Apr 2024 16:23:47 -0700 Subject: [PATCH] test(test_prometheus_service.py): remove duplicate test --- litellm/tests/test_prometheus_service.py | 61 ------------------------ 1 file changed, 61 deletions(-) diff --git a/litellm/tests/test_prometheus_service.py b/litellm/tests/test_prometheus_service.py index 1f562aa71ba..9e3441abb5f 100644 --- a/litellm/tests/test_prometheus_service.py +++ b/litellm/tests/test_prometheus_service.py @@ -139,64 +139,3 @@ async def test_router_with_caching(): except Exception as e: pytest.fail(f"An exception occured - {str(e)}") - - -@pytest.mark.asyncio -async def test_router_with_caching_bad_call(): - """ - - Run completion with caching (incorrect credentials) - - Assert failure callback gets called - """ - try: - - def get_azure_params(deployment_name: str): - params = { - "model": f"azure/{deployment_name}", - "api_key": os.environ["AZURE_API_KEY"], - "api_version": os.environ["AZURE_API_VERSION"], - "api_base": os.environ["AZURE_API_BASE"], - } - return params - - model_list = [ - { - "model_name": "azure/gpt-4", - "litellm_params": get_azure_params("chatgpt-v-2"), - "tpm": 100, - }, - { - "model_name": "azure/gpt-4", - "litellm_params": get_azure_params("chatgpt-v-2"), - "tpm": 1000, - }, - ] - - router = litellm.Router( - model_list=model_list, - set_verbose=True, - debug_level="DEBUG", - routing_strategy="usage-based-routing-v2", - redis_host="hello world", - redis_port=os.environ["REDIS_PORT"], - redis_password=os.environ["REDIS_PASSWORD"], - ) - - litellm.service_callback = ["prometheus_system"] - - sl = ServiceLogging(mock_testing=True) - sl.prometheusServicesLogger.mock_testing = True - router.cache.redis_cache.service_logger_obj = sl - - messages = [{"role": "user", "content": "Hey, how's it going?"}] - try: - response1 = await router.acompletion(model="azure/gpt-4", messages=messages) - response1 = await router.acompletion(model="azure/gpt-4", messages=messages) - except Exception as e: - pass - - assert sl.mock_testing_async_failure_hook > 0 - assert sl.mock_testing_async_success_hook == 0 - assert sl.mock_testing_sync_success_hook == 0 - - except Exception as e: - pytest.fail(f"An exception occured - {str(e)}")