Skip to content

Commit

Permalink
Add unit test name
Browse files Browse the repository at this point in the history
  • Loading branch information
aranke committed Mar 19, 2024
1 parent 16dec2f commit 5fb241e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/dbt/parser/unit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def process_models_for_unit_test(

if target_model_is_incremental and (not unit_test_def_has_incremental_override):
raise ParsingError(

Check warning on line 447 in core/dbt/parser/unit_tests.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/parser/unit_tests.py#L447

Added line #L447 was not covered by tests
f"Boolean override for 'is_incremental' must be provided for unit testing model '{target_model.name}'"
f"Boolean override for 'is_incremental' must be provided for unit test '{unit_test_def.name}' in model '{target_model.name}'"
)

unit_test_def_incremental_override_true = (
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/unit_testing/test_unit_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def models(self):
def test_no_override(self, project):
with pytest.raises(
ParsingError,
match="Boolean override for 'is_incremental' must be provided for unit testing model 'my_incremental_model'",
match="Boolean override for 'is_incremental' must be provided for unit test 'incremental_false' in model 'my_incremental_model'",
):
run_dbt(["parse"])

Expand All @@ -159,7 +159,7 @@ def models(self):
def test_str_override(self, project):
with pytest.raises(
ParsingError,
match="Boolean override for 'is_incremental' must be provided for unit testing model 'my_incremental_model'",
match="Boolean override for 'is_incremental' must be provided for unit test 'incremental_false' in model 'my_incremental_model'",
):
run_dbt(["parse"])

Expand Down

0 comments on commit 5fb241e

Please sign in to comment.