From ae54e6d8b0c49e61b084b282a5e720dfe7360e6d Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Fri, 5 Jan 2024 22:53:03 +0530 Subject: [PATCH] (ci/cd) proxy:test_add_new_key --- litellm/tests/test_proxy_server_keys.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/litellm/tests/test_proxy_server_keys.py b/litellm/tests/test_proxy_server_keys.py index 3399007e8..5dbbe4e2b 100644 --- a/litellm/tests/test_proxy_server_keys.py +++ b/litellm/tests/test_proxy_server_keys.py @@ -52,13 +52,6 @@ save_worker_config( save=False, use_queue=False, ) -app = FastAPI() -app.include_router(router) # Include your router in the test app - - -@app.on_event("startup") -async def wrapper_startup_event(): - await startup_event() import asyncio @@ -87,8 +80,10 @@ def client(): cleanup_router_config_variables() # rest proxy before test asyncio.run(initialize(config=config_fp, debug=True)) - with TestClient(app) as client: - yield client + app = FastAPI() + app.include_router(router) # Include your router in the test app + + return TestClient(app) def test_add_new_key(client):