Skip to content

Commit

Permalink
Fix Test QueryCommentArgs (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-rogers-dbt authored Jan 30, 2024
1 parent 9f66cbe commit 8f259f5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dbt/tests/adapter/query_comment/test_query_comment.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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}",
}
Expand Down

0 comments on commit 8f259f5

Please sign in to comment.