diff --git a/core/dbt/parser/unit_tests.py b/core/dbt/parser/unit_tests.py index 454bceee21e..1355a29f671 100644 --- a/core/dbt/parser/unit_tests.py +++ b/core/dbt/parser/unit_tests.py @@ -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( - 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 = ( diff --git a/tests/functional/unit_testing/test_unit_testing.py b/tests/functional/unit_testing/test_unit_testing.py index 43fa719979d..c680f012f55 100644 --- a/tests/functional/unit_testing/test_unit_testing.py +++ b/tests/functional/unit_testing/test_unit_testing.py @@ -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"]) @@ -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"])