diff --git a/litellm/tests/test_configs/custom_auth.py b/litellm/tests/test_configs/custom_auth.py index f3825038e1..e4747ee532 100644 --- a/litellm/tests/test_configs/custom_auth.py +++ b/litellm/tests/test_configs/custom_auth.py @@ -13,4 +13,4 @@ async def user_api_key_auth(request: Request, api_key: str) -> UserAPIKeyAuth: return UserAPIKeyAuth(api_key=api_key) raise Exception except: - raise Exception + raise Exception("Failed custom auth") diff --git a/litellm/tests/test_proxy_custom_auth.py b/litellm/tests/test_proxy_custom_auth.py index ceb3d1c934..b6b833e173 100644 --- a/litellm/tests/test_proxy_custom_auth.py +++ b/litellm/tests/test_proxy_custom_auth.py @@ -58,9 +58,10 @@ def test_custom_auth(client): headers = {"Authorization": f"Bearer {token}"} response = client.post("/chat/completions", json=test_data, headers=headers) - print(f"response: {response.text}") - assert response.status_code == 401 - result = response.json() - print(f"Received response: {result}") + pytest.fail("LiteLLM Proxy test failed. This request should have been rejected") except Exception as e: - pytest.fail("LiteLLM Proxy test failed. Exception", e) + print(vars(e)) + print("got an exception") + assert e.code == 401 + assert e.message == "Authentication Error, Failed custom auth" + pass