Skip to content

Commit d519031

Browse files
committed
Properly skip bedrock tests if token can't be retrieved
1 parent b78690a commit d519031

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_provider_bedrock.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
22

33
from chatlas import ChatBedrockAnthropic
4+
from botocore.exceptions import TokenRetrievalError
45

56
from .conftest import (
67
assert_data_extraction,
@@ -16,7 +17,8 @@
1617

1718
try:
1819
chat = ChatBedrockAnthropic()
19-
except Exception:
20+
chat.chat("What is 1 + 1?")
21+
except TokenRetrievalError:
2022
pytest.skip("Bedrock credentials aren't configured", allow_module_level=True)
2123

2224

0 commit comments

Comments
 (0)