From f47358ba1d7fa7fbfbad9ff645ab895aaa2a43d1 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Mon, 17 Jun 2024 20:33:39 -0700 Subject: [PATCH] test(test_utils.py): reset env after test complete --- litellm/tests/conftest.py | 2 +- litellm/tests/test_utils.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/litellm/tests/conftest.py b/litellm/tests/conftest.py index 244ea07544..eca0bc431a 100644 --- a/litellm/tests/conftest.py +++ b/litellm/tests/conftest.py @@ -21,7 +21,7 @@ def setup_and_teardown(): sys.path.insert( 0, os.path.abspath("../..") ) # Adds the project directory to the system path - print("LITELLM_LOG - {}".format(os.getenv("LITELLM_LOG"))) + import litellm from litellm import Router diff --git a/litellm/tests/test_utils.py b/litellm/tests/test_utils.py index 8151360045..70213c42d5 100644 --- a/litellm/tests/test_utils.py +++ b/litellm/tests/test_utils.py @@ -200,7 +200,7 @@ def test_trimming_with_model_cost_max_input_tokens(model): ) -def test_get_valid_models(): +def test_aget_valid_models(): old_environ = os.environ os.environ = {"OPENAI_API_KEY": "temp"} # mock set only openai key in environ @@ -227,6 +227,9 @@ def test_get_valid_models(): print(valid_models) assert valid_models == expected_models + # reset replicate env key + os.environ = old_environ + # test_get_valid_models()