Skip to content

Commit 12320ac

Browse files
committed
test(snowflake): assert transient DDL is emitted in incremental tests
Use run_dbt_and_capture with --debug to verify the tmp relation is actually created as a transient table, not just that the run succeeds.
1 parent e74ae64 commit 12320ac

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

dbt-snowflake/tests/functional/adapter/incremental/test_incremental_transient.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from dbt.tests.util import run_dbt
2+
from dbt.tests.util import run_dbt, run_dbt_and_capture
33

44

55
_MODEL_TRANSIENT_TMP = """
@@ -49,7 +49,9 @@ def test_incremental_transient(self, project):
4949
)
5050
assert result[0] == 1
5151

52-
run_dbt(["run"])
52+
_, logs = run_dbt_and_capture(["--debug", "run"])
53+
assert "create or replace transient table" in logs.lower()
54+
5355
result = project.run_sql(
5456
"select count(*) as cnt from {database}.{schema}.transient_incremental",
5557
fetch="one",
@@ -69,5 +71,8 @@ def models(self):
6971

7072
def test_incremental_transient_delete_insert_runs(self, project):
7173
run_dbt(["run"])
72-
run_dbt(["run"])
74+
75+
_, logs = run_dbt_and_capture(["--debug", "run"])
76+
assert "create or replace transient table" in logs.lower()
77+
7378
run_dbt(["test"])

0 commit comments

Comments
 (0)