mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
(test) proxy custom logger
This commit is contained in:
parent
b09ecb986e
commit
e10b701171
1 changed files with 7 additions and 12 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue