code: def test_env_var_substitution(self):
      substitutor = self.TEST_DIR / "substitutor.jsonnet"
      key = "TEST_ENV_VAR_SUBSTITUTION"
  
      assert os.environ.get(key) is None
  
      with open(substitutor, "w") as f:
          f.write(f'{{"path": std.extVar("{key}")}}')
  
      # raises without environment variable set
      with pytest.raises(RuntimeError):
          Params.from_file(substitutor)
  
      os.environ[key] = "PERFECT"
  
      params = Params.from_file(substitutor)
      assert params["path"] == "PERFECT"
  
      del os.environ[key]
  
imports: import json
  import os
  import re
  from collections import OrderedDict
  import pytest
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.params import infer_and_cast, Params, remove_keys_from_params, with_overrides
  from allennlp.common.testing import AllenNlpTestCase
label_desc: Use image node_id 10 for calling the TestParams obj's underlying member method code with example usage: obj.test_env_var_substitution() without return types