diff --git a/tests/functional/defer_state/test_modified_state.py b/tests/functional/defer_state/test_modified_state.py index 983cf0cb65c..86d2e5af2d8 100644 --- a/tests/functional/defer_state/test_modified_state.py +++ b/tests/functional/defer_state/test_modified_state.py @@ -1166,7 +1166,7 @@ def test_changed_vars(self, project): assert not run_dbt(["list", "-s", "state:modified", "--state", "./state"]) assert not run_dbt(["list", "-s", "state:modified.vars", "--state", "./state"]) - # Modify var (my_var: 1 -> 2 + # Modify var (my_var: 1 -> 2) update_config_file({"vars": {"my_var": 2}}, "dbt_project.yml") assert run_dbt(["list", "-s", "state:modified", "--state", "./state"]) == [ "test.view_model" @@ -1174,3 +1174,14 @@ def test_changed_vars(self, project): assert run_dbt(["list", "-s", "state:modified.vars", "--state", "./state"]) == [ "test.view_model" ] + + # Reset dbt_project.yml + update_config_file({"vars": {"my_var": 1}}, "dbt_project.yml") + + # Modify var via --var CLI flag + assert not run_dbt( + ["list", "--vars", '{"my_var": 1}', "-s", "state:modified", "--state", "./state"] + ) + assert run_dbt( + ["list", "--vars", '{"my_var": 2}', "-s", "state:modified", "--state", "./state"] + ) == ["test.view_model"]