mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
test(test_utils.py): reset env after test complete
This commit is contained in:
parent
a3e0267f1d
commit
f47358ba1d
2 changed files with 5 additions and 2 deletions
|
@ -21,7 +21,7 @@ def setup_and_teardown():
|
||||||
sys.path.insert(
|
sys.path.insert(
|
||||||
0, os.path.abspath("../..")
|
0, os.path.abspath("../..")
|
||||||
) # Adds the project directory to the system path
|
) # Adds the project directory to the system path
|
||||||
print("LITELLM_LOG - {}".format(os.getenv("LITELLM_LOG")))
|
|
||||||
import litellm
|
import litellm
|
||||||
from litellm import Router
|
from litellm import Router
|
||||||
|
|
||||||
|
|
|
@ -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
|
old_environ = os.environ
|
||||||
os.environ = {"OPENAI_API_KEY": "temp"} # mock set only openai key in 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)
|
print(valid_models)
|
||||||
assert valid_models == expected_models
|
assert valid_models == expected_models
|
||||||
|
|
||||||
|
# reset replicate env key
|
||||||
|
os.environ = old_environ
|
||||||
|
|
||||||
|
|
||||||
# test_get_valid_models()
|
# test_get_valid_models()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue