From 7fb3ccff105b2d74c971ff4e964f7672a4d6a264 Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Fri, 27 Sep 2024 19:54:15 +0100 Subject: [PATCH] fix logging --- core/dbt/parser/schemas.py | 2 +- .../functional/data_test_patch/test_singular_test_patch.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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