diff --git a/core/dbt/parser/schemas.py b/core/dbt/parser/schemas.py index 56a27a9b9d6..cf2c3b7f109 100644 --- a/core/dbt/parser/schemas.py +++ b/core/dbt/parser/schemas.py @@ -218,7 +218,7 @@ def parse_file(self, block: FileBlock, dct: Optional[Dict] = None) -> None: except ParsingError as e: fire_event( Note( - msg=f"Unable to parse 'data_tests' in {block.path.original_file_path}\n{e}", + msg=f"Unable to parse 'data_tests' section of file '{block.path.original_file_path}'\n{e}", ), EventLevel.WARN, ) diff --git a/tests/functional/data_test_patch/test_singular_test_patch.py b/tests/functional/data_test_patch/test_singular_test_patch.py index 43e98f64444..bb00a13bac4 100644 --- a/tests/functional/data_test_patch/test_singular_test_patch.py +++ b/tests/functional/data_test_patch/test_singular_test_patch.py @@ -44,7 +44,7 @@ def test_compile(self, project): _, log_output = run_dbt_and_capture(["compile"]) file_path = ( - "tests\\schem a_with_invalid_name.yml" + "tests\\schema_with_invalid_name.yml" if os.name == "nt" else "tests/schema_with_invalid_name.yml" ) @@ -64,4 +64,6 @@ def tests(self): def test_compile(self, project): _, log_output = run_dbt_and_capture(["compile"]) - assert "Unable to parse 'data_tests' in tests/schema.yml" in log_output + file_path = "tests\\schema.yml" if os.name == "nt" else "tests/schema.yml" + assert f"Unable to parse 'data_tests' section of file '{file_path}'" in log_output + assert "Entry did not contain a name" in log_output