diff --git a/litellm/tests/test_aamazing_proxy_custom_logger.py b/litellm/tests/test_aamazing_proxy_custom_logger.py index ce25cd226ed..353036a9b8c 100644 --- a/litellm/tests/test_aamazing_proxy_custom_logger.py +++ b/litellm/tests/test_aamazing_proxy_custom_logger.py @@ -24,20 +24,15 @@ filepath = os.path.dirname(os.path.abspath(__file__)) config_fp = f"{filepath}/test_configs/test_custom_logger.yaml" python_file_path = f"{filepath}/test_configs/custom_callbacks.py" save_worker_config(config=config_fp, model=None, alias=None, api_base=None, api_version=None, debug=False, temperature=None, max_tokens=None, request_timeout=600, max_budget=None, telemetry=False, drop_params=True, add_function_to_prompt=False, headers=None, save=False, use_queue=False) - -@pytest.fixture(scope="function", autouse=True) -def app(): - app = FastAPI() - app.include_router(router) - - # Perform the startup initialization only once - initialize(config=config_fp, model=None, alias=None, api_base=None, api_version=None, debug=True, temperature=None, max_tokens=None, request_timeout=600, max_budget=None, telemetry=False, drop_params=True, add_function_to_prompt=False, headers=None, save=False, use_queue=False) - - return app +app = FastAPI() +app.include_router(router) # Include your router in the test app +@app.on_event("startup") +async def wrapper_startup_event(): + initialize(config=config_fp) # Use the app fixture in your client fixture -@pytest.fixture -def client(app): +@pytest.fixture(autouse=True) +def client(): with TestClient(app) as client: yield client