diff --git a/packages/phoenix-evals/tests/phoenix/evals/models/test_bedrock.py b/packages/phoenix-evals/tests/phoenix/evals/models/test_bedrock.py index e6b9eccd4ec..3141a8ae6d0 100644 --- a/packages/phoenix-evals/tests/phoenix/evals/models/test_bedrock.py +++ b/packages/phoenix-evals/tests/phoenix/evals/models/test_bedrock.py @@ -1,4 +1,8 @@ +import asyncio + import boto3 +import pytest + from phoenix.evals import BedrockModel @@ -6,3 +10,14 @@ def test_bedrock_model_can_be_instantiated(): session = boto3.Session(region_name="us-west-2") model = BedrockModel(session=session) assert model + + +def test_bedrock_async_propagates_errors(): + with pytest.raises( + AttributeError, match="'NoneType' object has no attribute 'invoke_model'" + ): + session = boto3.Session(region_name="us-west-2") + client = session.client("bedrock-runtime") + model = BedrockModel(session=session, client=client) + model.client = None + asyncio.run(model._async_generate("prompt"))