Skip to content

Commit 82c3e82

Browse files
author
Lou Kratz
committed
Test error propogation
1 parent 7efc3e8 commit 82c3e82

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
1+
import asyncio
2+
13
import boto3
4+
import pytest
5+
26
from phoenix.evals import BedrockModel
37

48

59
def test_bedrock_model_can_be_instantiated():
610
session = boto3.Session(region_name="us-west-2")
711
model = BedrockModel(session=session)
812
assert model
13+
14+
15+
def test_bedrock_async_propagates_errors():
16+
with pytest.raises(
17+
AttributeError, match="'NoneType' object has no attribute 'invoke_model'"
18+
):
19+
session = boto3.Session(region_name="us-west-2")
20+
client = session.client("bedrock-runtime")
21+
model = BedrockModel(session=session, client=client)
22+
model.client = None
23+
asyncio.run(model._async_generate("prompt"))

0 commit comments

Comments
 (0)