code: def test_variable_set_with_env_variable(self, caplog):
      caplog.set_level(logging.WARNING, logger=variable.log.name)
      Variable.set("key", "db-value")
      with mock.patch.dict("os.environ", AIRFLOW_VAR_KEY="env-value"):
          # setting value while shadowed by an env variable will generate a warning
          Variable.set("key", "new-db-value")
          # value set above is not returned because the env variable value takes priority
          assert "env-value" == Variable.get("key")
      # invalidate the cache to re-evaluate value
      SecretCache.invalidate_variable("key")
      # now that env var is not here anymore, we see the value we set before.
      assert "new-db-value" == Variable.get("key")
  
      assert caplog.messages[0] == (
          "The variable key is defined in the EnvironmentVariablesBackend secrets backend, "
          "which takes precedence over reading from the database. The value in the database "
          "will be updated, but to read it you have to delete the conflicting variable from "
          "EnvironmentVariablesBackend"
      )
  
imports: from __future__ import annotations
  import logging
  import os
  from unittest import mock
  import pytest
  from cryptography.fernet import Fernet
  from airflow import settings
  from airflow.models import Variable, crypto, variable
  from airflow.secrets.cache import SecretCache
  from airflow.secrets.metastore import MetastoreBackend
  from tests.test_utils import db
  from tests.test_utils.config import conf_vars
label_desc: Use image node_id 6 for calling the TestVariable obj's underlying member method code with example usage: obj.test_variable_set_with_env_variable(caplog) without return types