Skip to content

Commit

Permalink
fix sql client tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Oct 7, 2024
1 parent 89a9861 commit 631d50b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/load/filesystem/test_sql_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
from tests.utils import TEST_STORAGE_ROOT
from dlt.destinations.exceptions import DatabaseUndefinedRelation

TEST_SECRET_NAME = "TEST_SECRET"


def _run_dataset_checks(
pipeline: Pipeline,
Expand All @@ -32,6 +30,8 @@ def _run_dataset_checks(
) -> None:
total_records = 200

TEST_SECRET_NAME = "TEST_SECRET" + uniq_id()

# only some buckets have support for persistent secrets
needs_persistent_secrets = (
destination_config.bucket_url.startswith("s3")
Expand Down Expand Up @@ -76,7 +76,7 @@ def double_items():
pipeline.destination = alternate_access_pipeline.destination

import duckdb
from duckdb import HTTPException
from duckdb import HTTPException, IOException
from dlt.destinations.impl.filesystem.sql_client import (
FilesystemSqlClient,
DuckDbCredentials,
Expand Down Expand Up @@ -169,7 +169,7 @@ def _fs_sql_client_for_external_db(

# in other cases secrets are not available and this should fail
external_db = _external_duckdb_connection()
with pytest.raises(HTTPException):
with pytest.raises((HTTPException, IOException)):
assert (
len(external_db.sql("SELECT * FROM second.referenced_items").fetchall())
== total_records
Expand All @@ -195,7 +195,7 @@ def _fs_sql_client_for_external_db(

# fails again
external_db = _external_duckdb_connection()
with pytest.raises(HTTPException):
with pytest.raises((HTTPException, IOException)):
assert (
len(external_db.sql("SELECT * FROM second.referenced_items").fetchall())
== total_records
Expand Down

0 comments on commit 631d50b

Please sign in to comment.