From 6cdcc1370f02c6652bf86a7e948fb45959a5c51c Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 13 Dec 2023 21:05:07 -0800 Subject: [PATCH] test(test_custom_callback_router.py): fix testing --- litellm/tests/test_custom_callback_input.py | 2 +- litellm/tests/test_custom_callback_router.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/tests/test_custom_callback_input.py b/litellm/tests/test_custom_callback_input.py index 5f147641c..d193c53b6 100644 --- a/litellm/tests/test_custom_callback_input.py +++ b/litellm/tests/test_custom_callback_input.py @@ -198,7 +198,7 @@ class CompletionCustomHandler(CustomLogger): # https://docs.litellm.ai/docs/obse assert isinstance(kwargs['original_response'], (str, litellm.CustomStreamWrapper)) or inspect.isasyncgen(kwargs['original_response']) or inspect.iscoroutine(kwargs['original_response']) assert isinstance(kwargs['additional_args'], (dict, type(None))) assert isinstance(kwargs['log_event_type'], str) - assert isinstance(kwargs["cache_hit"], (bool, type(None))) + assert kwargs["cache_hit"] is None or isinstance(kwargs["cache_hit"], bool) except: print(f"Assertion Error: {traceback.format_exc()}") self.errors.append(traceback.format_exc()) diff --git a/litellm/tests/test_custom_callback_router.py b/litellm/tests/test_custom_callback_router.py index 8e1d20943..43d532521 100644 --- a/litellm/tests/test_custom_callback_router.py +++ b/litellm/tests/test_custom_callback_router.py @@ -150,7 +150,7 @@ class CompletionCustomHandler(CustomLogger): # https://docs.litellm.ai/docs/obse assert isinstance(kwargs['original_response'], (str, litellm.CustomStreamWrapper)) assert isinstance(kwargs['additional_args'], (dict, type(None))) assert isinstance(kwargs['log_event_type'], str) - assert isinstance(kwargs["cache_hit"], Optional[bool]) + assert kwargs["cache_hit"] is None or isinstance(kwargs["cache_hit"], bool) except: print(f"Assertion Error: {traceback.format_exc()}") self.errors.append(traceback.format_exc())