Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tests/integration/dbapi/async/V2/test_errors_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def test_account_no_user(
"""Connection properly reacts to account that doesn't have
a user attached to it."""

with raises(AccountNotFoundOrNoAccessError) as exc_info:
with raises((AccountNotFoundOrNoAccessError, FireboltStructuredError)) as exc_info:
async with await connect(
database=database_name,
auth=auth_no_user,
Expand All @@ -50,8 +50,12 @@ async def test_account_no_user(
) as connection:
await connection.cursor().execute("show tables")

assert f"'{account_name}' does not exist" in str(
exc_info.value
assert str(exc_info.value).startswith(
f"Account '{account_name}' does not exist"
) or (
# Caching on the backend may cause this error instead
f"Database '{database_name}' does not exist or not authorized."
in str(exc_info.value)
), "Invalid account error message."


Expand Down
6 changes: 5 additions & 1 deletion tests/integration/dbapi/sync/V2/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_account_no_user(
api_endpoint: str,
) -> None:
"""Connection properly reacts to invalid account error."""
with raises(AccountNotFoundOrNoAccessError) as exc_info:
with raises((AccountNotFoundOrNoAccessError, FireboltStructuredError)) as exc_info:
with connect(
database=database_name,
auth=auth_no_user,
Expand All @@ -50,6 +50,10 @@ def test_account_no_user(

assert str(exc_info.value).startswith(
f"Account '{account_name}' does not exist"
) or (
# Caching on the backend may cause this error instead
f"Database '{database_name}' does not exist or not authorized."
in str(exc_info.value)
), "Invalid account error message."


Expand Down
Loading