Skip to content

Commit 4534005

Browse files
committed
make test hermetic
1 parent 84fb0ce commit 4534005

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

tests/functional/adapter/incremental/test_incremental_constraints.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,31 @@ def test_add_foreign_key_constraint(self, project):
216216
expected_pairs = {("fk_to_parent", "pk_parent"), ("fk_to_parent_2", "pk_parent_2")}
217217
assert constraint_pairs == expected_pairs
218218

219+
220+
@pytest.mark.skip_profile("databricks_cluster")
221+
class TestIncrementalDiff:
222+
@pytest.fixture(scope="class")
223+
def project_config_update(self):
224+
return {
225+
"flags": {"use_materialization_v2": True},
226+
}
227+
228+
@pytest.fixture(scope="class")
229+
def models(self):
230+
return {
231+
"model_a.sql": fixtures.warn_unenforced_override_sql,
232+
"model_b.sql": fixtures.warn_unenforced_override_sql,
233+
"schema.yml": fixtures.warn_unenforced_override_model,
234+
}
235+
219236
# Specifically for testing bugs like https://github.com/databricks/dbt-databricks/issues/1081
220237
# where the config diff between the existing relation and model definition incorrectly detected
221238
# constraints that were not changed. This is because the TypedConstraint read from existing
222239
# Databricks relations will just have a default value for warn_unenforced which should
223240
# be ignored during the diff
224241
def test_warn_unenforced_false(self, project):
225-
util.run_dbt(["run"])
226242
referential_constraints = project.run_sql(referential_constraint_sql, fetch="all")
227243
assert len(referential_constraints) == 0
228-
229-
util.write_file(fixtures.warn_unenforced_override_sql, "models", "model_a.sql")
230-
util.write_file(fixtures.warn_unenforced_override_sql, "models", "model_b.sql")
231-
util.write_file(fixtures.warn_unenforced_override_model, "models", "schema.yml")
232244
util.run_dbt(["run"])
233245
util.run_dbt(["run"])
234246
referential_constraints = project.run_sql(referential_constraint_sql, fetch="all")

0 commit comments

Comments
 (0)