Skip to content

Commit

Permalink
fix tests/functional/adapter/test_query_comment.py::TestMacroArgsQuer…
Browse files Browse the repository at this point in the history
…yComments::test_matches_comment to use correct dbt_version (ref dbt-labs/dbt-core)
  • Loading branch information
arthurcht committed Mar 1, 2024
1 parent c898b86 commit 8770d49
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/functional/adapter/test_query_comment.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import json

from dbt.tests.adapter.query_comment.test_query_comment import (
BaseEmptyQueryComments,
BaseMacroArgsQueryComments,
Expand All @@ -6,6 +8,7 @@
BaseNullQueryComments,
BaseQueryComments,
)
from dbt.version import __version__ as dbt_version


class TestQueryCommentsSynapse(BaseQueryComments):
Expand All @@ -17,7 +20,18 @@ class TestMacroQueryCommentsSynapse(BaseMacroQueryComments):


class TestMacroArgsQueryCommentsSynapse(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 TestMacroInvalidQueryCommentsSynapse(BaseMacroInvalidQueryComments):
Expand Down

0 comments on commit 8770d49

Please sign in to comment.