diff --git a/test/unit/test_base_context.py b/test/unit/test_base_context.py index 462323de5d7..0dc2d93ddca 100644 --- a/test/unit/test_base_context.py +++ b/test/unit/test_base_context.py @@ -1,3 +1,5 @@ +import os + from dbt.context.base import BaseContext from jinja2.runtime import Undefined @@ -10,3 +12,11 @@ def test_log_jinja_undefined(self): BaseContext.log(msg=Undefined(), info=True) except Exception as e: assert False, f"Logging an jinja2.Undefined object raises an exception: {e}" + + def test_log_with_dbt_env_secret(self): + # regression test for CT-1783 + try: + os.environ["DBT_ENV_SECRET_LOG_TEST"] = "cats_are_cool" + BaseContext.log({"fact1": "I like cats"}, info=True) + except Exception as e: + assert False, f"Logging while a `DBT_ENV_SECRET` was set raised an exception: {e}"