From 278cbb7e3cf58a63cc93e7730357c40f86fef4ad Mon Sep 17 00:00:00 2001 From: "Arthur Chionh (dataroots)" <90323829+arthurcht@users.noreply.github.com> Date: Fri, 1 Mar 2024 12:42:34 +0100 Subject: [PATCH] fix tests/functional/adapter/test_query_comment.py::TestMacroArgsQueryComments::test_matches_comment to use correct dbt_version (ref dbt-labs/dbt-core) --- tests/functional/adapter/test_query_comment.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/functional/adapter/test_query_comment.py b/tests/functional/adapter/test_query_comment.py index 43223be..1488274 100644 --- a/tests/functional/adapter/test_query_comment.py +++ b/tests/functional/adapter/test_query_comment.py @@ -6,6 +6,8 @@ BaseNullQueryComments, BaseQueryComments, ) +from dbt.version import __version__ as dbt_version +import json # Tests # @@ -18,7 +20,18 @@ class TestMacroQueryComments(BaseMacroQueryComments): class TestMacroArgsQueryComments(BaseMacroArgsQueryComments): - pass + def test_matches_comment(self, project) -> bool: + logs = self.run_get_json() + expected_dct = { + "app": "dbt++", + "dbt_version": dbt_version, + "macro_version": "0.1.0", + "message": f"blah: {project.adapter.config.target_name}", + } + expected = r"/* {} */\n".format(json.dumps(expected_dct, sort_keys=True)).replace( + '"', r"\"" + ) + assert expected in logs class TestMacroInvalidQueryComments(BaseMacroInvalidQueryComments):