Skip to content

Commit

Permalink
Test error propogation
Browse files Browse the repository at this point in the history
  • Loading branch information
lou-k committed Jul 16, 2024
1 parent 7efc3e8 commit 82c3e82
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/phoenix-evals/tests/phoenix/evals/models/test_bedrock.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
import asyncio

import boto3
import pytest

from phoenix.evals import BedrockModel


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"))

0 comments on commit 82c3e82

Please sign in to comment.