@@ -38,7 +38,7 @@ def test_dbt_run_operation_mocked_all_args():
3838
3939
4040def test_dbt_run_operation_non_existent_macro (
41- profiles_file , dbt_project_file , macro_file
41+ profiles_file , dbt_project_file , macro_name
4242):
4343 """Test exectuion of DbtRunOperationOperator with a non-existent macro."""
4444 op = DbtRunOperationOperator (
@@ -53,33 +53,47 @@ def test_dbt_run_operation_non_existent_macro(
5353
5454
5555def test_dbt_run_operation_missing_arguments (
56- profiles_file , dbt_project_file , macro_file
56+ profiles_file , dbt_project_file , macro_name
5757):
5858 """Test exectuion of DbtRunOperationOperator with missing arguments."""
5959 op = DbtRunOperationOperator (
6060 task_id = "dbt_task" ,
6161 project_dir = dbt_project_file .parent ,
6262 profiles_dir = profiles_file .parent ,
63- macro = str ( macro_file . stem ) ,
63+ macro = macro_name ,
6464 )
6565
6666 with pytest .raises (AirflowException ):
6767 op .execute ({})
6868
6969
70- def test_dbt_run_operation_run_macro (profiles_file , dbt_project_file , macro_file ):
70+ def test_dbt_run_operation_run_macro (profiles_file , dbt_project_file , macro_name ):
7171 """Test a dbt run-operation operator basic execution."""
7272 op = DbtRunOperationOperator (
7373 task_id = "dbt_task" ,
7474 project_dir = dbt_project_file .parent ,
7575 profiles_dir = profiles_file .parent ,
76- macro = str ( macro_file . stem ) ,
76+ macro = macro_name ,
7777 args = {"an_arg" : 123 },
7878 )
7979 execution_results = op .execute ({})
8080 assert execution_results ["success" ] is True
8181
8282
83+ def test_dbt_run_operation_run_non_arg_macro (
84+ profiles_file , dbt_project_file , non_arg_macro_name
85+ ):
86+ """Test a dbt run-operation operator basic execution."""
87+ op = DbtRunOperationOperator (
88+ task_id = "dbt_task" ,
89+ project_dir = dbt_project_file .parent ,
90+ profiles_dir = profiles_file .parent ,
91+ macro = non_arg_macro_name ,
92+ )
93+ execution_results = op .execute ({})
94+ assert execution_results ["success" ] is True
95+
96+
8397BROKEN_MACRO1 = """
8498{% macro my_broken_macro(an_arg) %}
8599{% set sql %}
0 commit comments