Skip to content

Commit

Permalink
test macro: set model_node_being_tested before caller() (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzorin authored Jul 23, 2024
1 parent 2be7196 commit 5e9553d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion macros/tests.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
{% if execute %}
{% if flags.WHICH in ('test', 'build') %}
{{ dbt_unit_testing.set_test_context("is_incremental_should_be_true_for_this_model", "") }}
{% set mocks_and_expectations_json_str = caller() %}
{% set model_version = kwargs["version"] | default(kwargs["v"]) | default(none) %}
{% set model_node = {"package_name": model.package_name, "name": model_name, "version": model_version} %}
{{ dbt_unit_testing.set_test_context("model_node_being_tested", model_node) }}
{% set mocks_and_expectations_json_str = caller() %}
{% set test_configuration, test_queries = dbt_unit_testing.build_configuration_and_test_queries(model_node, test_description, options, mocks_and_expectations_json_str) %}
{% set test_report = dbt_unit_testing.build_test_report(test_configuration, test_queries) %}

Expand Down

0 comments on commit 5e9553d

Please sign in to comment.