From 9f118bb5db4acd6b051399a5504a7d9e6f836dcf Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sat, 7 Oct 2023 18:19:55 -0700 Subject: [PATCH] ci(test_logging): debugging circle ci --- .circleci/config.yml | 1 + litellm/tests/test_logging.py | 40 +++++++++++++++++------------------ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1425bdd28..31cea53a5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -55,6 +55,7 @@ jobs: name: Run tests command: | pwd + ls python -m pytest -vv tests/test_logging.py --junitxml=test-results/junit.xml no_output_timeout: 30m diff --git a/litellm/tests/test_logging.py b/litellm/tests/test_logging.py index 7187193ad..c8a353075 100644 --- a/litellm/tests/test_logging.py +++ b/litellm/tests/test_logging.py @@ -41,28 +41,28 @@ messages = [{"content": user_message, "role": "user"}] # 1. On Call Success # normal completion ## test on openai completion call -def test_logging_success_completion(): - global score - try: - # Redirect stdout - old_stdout = sys.stdout - sys.stdout = new_stdout = io.StringIO() +# def test_logging_success_completion(): +# global score +# try: +# # Redirect stdout +# old_stdout = sys.stdout +# sys.stdout = new_stdout = io.StringIO() - response = completion(model="gpt-3.5-turbo", messages=messages) - # Restore stdout - sys.stdout = old_stdout - output = new_stdout.getvalue().strip() +# response = completion(model="gpt-3.5-turbo", messages=messages) +# # Restore stdout +# sys.stdout = old_stdout +# output = new_stdout.getvalue().strip() - if "Logging Details Pre-API Call" not in output: - raise Exception("Required log message not found!") - elif "Logging Details Post-API Call" not in output: - raise Exception("Required log message not found!") - elif "Logging Details LiteLLM-Success Call" not in output: - raise Exception("Required log message not found!") - score += 1 - except Exception as e: - pytest.fail(f"Error occurred: {e}") - pass +# if "Logging Details Pre-API Call" not in output: +# raise Exception("Required log message not found!") +# elif "Logging Details Post-API Call" not in output: +# raise Exception("Required log message not found!") +# elif "Logging Details LiteLLM-Success Call" not in output: +# raise Exception("Required log message not found!") +# score += 1 +# except Exception as e: +# pytest.fail(f"Error occurred: {e}") +# pass # ## test on non-openai completion call # def test_logging_success_completion_non_openai():