test(test_logging): add back more tests for circle ci

This commit is contained in:
Krrish Dholakia 2023-10-07 18:10:51 -07:00
parent a871d85696
commit cd8ae2ecf6

View file

@ -64,30 +64,30 @@ def test_logging_success_completion():
pytest.fail(f"Error occurred: {e}") pytest.fail(f"Error occurred: {e}")
pass pass
# ## test on non-openai completion call ## test on non-openai completion call
# def test_logging_success_completion_non_openai(): def test_logging_success_completion_non_openai():
# global score global score
# try: try:
# # Redirect stdout # Redirect stdout
# old_stdout = sys.stdout old_stdout = sys.stdout
# sys.stdout = new_stdout = io.StringIO() sys.stdout = new_stdout = io.StringIO()
# response = completion(model="claude-instant-1", messages=messages) response = completion(model="claude-instant-1", messages=messages)
# # Restore stdout # Restore stdout
# sys.stdout = old_stdout sys.stdout = old_stdout
# output = new_stdout.getvalue().strip() output = new_stdout.getvalue().strip()
# if "Logging Details Pre-API Call" not in output: if "Logging Details Pre-API Call" not in output:
# raise Exception("Required log message not found!") raise Exception("Required log message not found!")
# elif "Logging Details Post-API Call" not in output: elif "Logging Details Post-API Call" not in output:
# raise Exception("Required log message not found!") raise Exception("Required log message not found!")
# elif "Logging Details LiteLLM-Success Call" not in output: elif "Logging Details LiteLLM-Success Call" not in output:
# raise Exception("Required log message not found!") raise Exception("Required log message not found!")
# score += 1 score += 1
# except Exception as e: except Exception as e:
# pytest.fail(f"Error occurred: {e}") pytest.fail(f"Error occurred: {e}")
# pass pass
# # streaming completion # # streaming completion
# ## test on openai completion call # ## test on openai completion call