From dd445e1fde0cb5a552d0a25e1d6fcc518989946b Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Tue, 6 Jun 2023 13:30:50 -0700 Subject: [PATCH] generalize BaseModelConstraintsRuntimeEnforcement (#7805) --- .../dbt/tests/adapter/constraints/test_constraints.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/adapter/dbt/tests/adapter/constraints/test_constraints.py b/tests/adapter/dbt/tests/adapter/constraints/test_constraints.py index 49e78d19a34..de78143aff7 100644 --- a/tests/adapter/dbt/tests/adapter/constraints/test_constraints.py +++ b/tests/adapter/dbt/tests/adapter/constraints/test_constraints.py @@ -228,7 +228,8 @@ def test__constraints_ddl(self, project, expected_sql): ) results = run_dbt(["run", "-s", "+my_model"]) - assert len(results) == 2 + # assert at least my_model was run - additional upstreams may or may not be provided to the test setup via models fixture + assert len(results) >= 1 # grab the sql and replace the model identifier to make it generic for all adapters # the name is not what we're testing here anyways and varies based on materialization @@ -481,7 +482,8 @@ def test__model_constraints_ddl(self, project, expected_sql): ) results = run_dbt(["run", "-s", "+my_model"]) - assert len(results) == 2 + # assert at least my_model was run - additional upstreams may or may not be provided to the test setup via models fixture + assert len(results) >= 1 generated_sql = read_file("target", "run", "test", "models", "my_model.sql") generated_sql_modified = _normalize_whitespace(generated_sql) generated_sql_generic = _find_and_replace(