diff --git a/litellm/tests/test_rules.py b/litellm/tests/test_rules.py index 7e2d7b8196..0bafbf48f7 100644 --- a/litellm/tests/test_rules.py +++ b/litellm/tests/test_rules.py @@ -132,12 +132,15 @@ def test_post_call_rule_streaming(): ) -def test_post_call_processing_error_async_response(): - response = asyncio.run( - acompletion( +@pytest.mark.asyncio +async def test_post_call_processing_error_async_response(): + try: + response = await acompletion( model="command-nightly", # Just used as an example messages=[{"content": "Hello, how are you?", "role": "user"}], api_base="https://openai-proxy.berriai.repl.co", # Just used as an example custom_llm_provider="openai", ) - ) + pytest.fail("This call should have failed") + except Exception as e: + pass