code: def test_legacy_interpolation(
      config_name: str,
      overrides: List[str],
      expected: DefaultsTreeNode,
      hydra_restore_singletons: Any,
  ) -> None:
      msg = dedent(
          """
      Defaults list element '.*=.*' is using a deprecated interpolation form.
      See http://hydra.cc/docs/1.1/upgrades/1.0_to_1.1/defaults_list_interpolation for migration information."""
      )
      version.setbase("1.1")
      with warns(expected_warning=UserWarning, match=msg):
          _test_defaults_tree_impl(
              config_name=config_name,
              input_overrides=overrides,
              expected=expected,
          )
  
      version.setbase("1.2")
      with raises(ConfigCompositionException, match=msg):
          _test_defaults_tree_impl(
              config_name=config_name,
              input_overrides=overrides,
              expected=expected,
          )
  
imports: import re
  from textwrap import dedent
  from typing import Any, Dict, List, Optional
  from pytest import mark, param, raises, warns
  from hydra import version
  from hydra.core.default_element import ConfigDefault, DefaultsTreeNode, GroupDefault, VirtualRoot
  from hydra.core.plugins import Plugins
  from hydra.errors import ConfigCompositionException
  from hydra.test_utils.test_utils import chdir_hydra_root
  from tests.defaults_list import _test_defaults_tree_impl
label_desc: Use image node_id 27 for calling a global function with example usage: test_legacy_interpolation(config_name, overrides, expected, hydra_restore_singletons) without return types