Skip to content

Commit 3754cb9

Browse files
committed
test(spog): skip SPOG functional tests on pre-SPOG deps
Add a session-scoped autouse fixture that calls pytest.skip when either the installed databricks-sdk or databricks-sql-connector pre-dates SPOG support. The fixture short-circuits before any setup, so min-deps runs (sdk 0.68.0 + connector 4.1.2) no longer attempt to open SPOG-decorated connections that the floor stack can't honor. Verified in the min-deps hatch env: all 3 SPOG tests skipped in 0.01s.
1 parent bfb7cf2 commit 3754cb9

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/functional/adapter/spog/conftest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,22 @@
44

55
import pytest
66

7+
from dbt.adapters.databricks.spog.capabilities import (
8+
connector_supports_spog,
9+
sdk_supports_workspace_id,
10+
)
711
from tests.profiles import get_databricks_cluster_target
812

913

14+
@pytest.fixture(scope="session", autouse=True)
15+
def _require_spog_deps():
16+
if not (connector_supports_spog() and sdk_supports_workspace_id()):
17+
pytest.skip(
18+
"SPOG functional tests require databricks-sdk and databricks-sql-connector "
19+
"with SPOG support installed."
20+
)
21+
22+
1023
def _workspace_id() -> str:
1124
workspace_id = os.getenv("TEST_PECO_SPOG_WORKSPACE_ID")
1225
if not workspace_id:

0 commit comments

Comments
 (0)