Skip to content

Commit 5fd351c

Browse files
authored
chore: update test support single catalog (#1641)
1 parent 1c6b2f9 commit 5fd351c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/core/engine_adapter/test_integration.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from sqlmesh.core.engine_adapter.shared import DataObject
1919
from sqlmesh.utils import nullsafe_join
2020
from sqlmesh.utils.date import to_ds
21+
from sqlmesh.utils.errors import UnsupportedCatalogOperationError
2122
from sqlmesh.utils.pydantic import PydanticModel
2223

2324
if t.TYPE_CHECKING:
@@ -281,7 +282,10 @@ def ctx(engine_adapter, test_type):
281282

282283

283284
def test_catalog_operations(ctx: TestContext):
284-
if ctx.dialect in {"mysql", "redshift", "postgres"}:
285+
if (
286+
ctx.engine_adapter.CATALOG_SUPPORT.is_unsupported
287+
or ctx.engine_adapter.CATALOG_SUPPORT.is_single_catalog_only
288+
):
285289
pytest.skip(
286290
f"Engine adapter {ctx.engine_adapter.dialect} doesn't support catalog operations"
287291
)
@@ -363,7 +367,13 @@ def create_objects_and_validate(schema_name: str):
363367
catalog_name = "tobiko-test"
364368

365369
schema = ctx.schema("drop_schema_catalog_test", catalog_name)
366-
drop_schema_and_validate(schema)
370+
if ctx.engine_adapter.CATALOG_SUPPORT.is_single_catalog_only:
371+
with pytest.raises(
372+
UnsupportedCatalogOperationError,
373+
match=".*requires that all catalog operations be against a single catalog.*",
374+
):
375+
drop_schema_and_validate(schema)
376+
return
367377
create_objects_and_validate(schema)
368378
drop_schema_and_validate(schema)
369379

0 commit comments

Comments
 (0)