diff --git a/dbt/tests/adapter/query_comment/test_query_comment.py b/dbt/tests/adapter/query_comment/test_query_comment.py index 5c139490..66251c1d 100644 --- a/dbt/tests/adapter/query_comment/test_query_comment.py +++ b/dbt/tests/adapter/query_comment/test_query_comment.py @@ -1,9 +1,9 @@ import json +from importlib import import_module import pytest from dbt_common.exceptions import DbtRuntimeError -from dbt.tests.__about__ import version as PACKAGE_VERSION from dbt.tests.adapter.query_comment import fixtures from dbt.tests.util import run_dbt_and_capture @@ -53,15 +53,19 @@ def test_matches_comment(self, project): class BaseMacroArgsQueryComments(BaseDefaultQueryComments): + @pytest.fixture(scope="class") + def get_package_version(self, project): + return import_module("." + project.adapter_type, "dbt.adapters").__version__.version + @pytest.fixture(scope="class") def project_config_update(self): return {"query-comment": "{{ return(ordered_to_json(query_header_args(target.name))) }}"} - def test_matches_comment(self, project): + def test_matches_comment(self, project, get_package_version): logs = self.run_get_json() expected_dct = { "app": "dbt++", - "dbt_version": PACKAGE_VERSION, + "dbt_version": get_package_version, "macro_version": "0.1.0", "message": f"blah: {project.adapter.config.target_name}", }