mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-19 00:01:29 +00:00
(ci/cd) use fixture
This commit is contained in:
parent
7cb49ee509
commit
858f39629f
1 changed files with 9 additions and 8 deletions
|
|
@ -24,7 +24,14 @@ from litellm.proxy.proxy_server import (
|
|||
)
|
||||
|
||||
|
||||
def test_proxy_gunicorn_startup_direct_config():
|
||||
@pytest.fixture
|
||||
def cleanup_router_config():
|
||||
from litellm.proxy.proxy_server import cleanup_router_config_variables
|
||||
|
||||
cleanup_router_config_variables()
|
||||
|
||||
|
||||
def test_proxy_gunicorn_startup_direct_config(cleanup_router_config):
|
||||
"""
|
||||
gunicorn startup requires the config to be passed in via environment variables
|
||||
|
||||
|
|
@ -33,9 +40,6 @@ def test_proxy_gunicorn_startup_direct_config():
|
|||
Test both approaches
|
||||
"""
|
||||
try:
|
||||
from litellm.proxy.proxy_server import cleanup_router_config_variables
|
||||
|
||||
cleanup_router_config_variables()
|
||||
filepath = os.path.dirname(os.path.abspath(__file__))
|
||||
# test with worker_config = config yaml
|
||||
config_fp = f"{filepath}/test_configs/test_config_no_auth.yaml"
|
||||
|
|
@ -49,11 +53,8 @@ def test_proxy_gunicorn_startup_direct_config():
|
|||
pytest.fail(f"An exception occurred - {str(e)}")
|
||||
|
||||
|
||||
def test_proxy_gunicorn_startup_config_dict():
|
||||
def test_proxy_gunicorn_startup_config_dict(cleanup_router_config):
|
||||
try:
|
||||
from litellm.proxy.proxy_server import cleanup_router_config_variables
|
||||
|
||||
cleanup_router_config_variables()
|
||||
filepath = os.path.dirname(os.path.abspath(__file__))
|
||||
# test with worker_config = config yaml
|
||||
config_fp = f"{filepath}/test_configs/test_config_no_auth.yaml"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue