code: def test_environment_variables_reuse(shutdown_only):
      """Test that new tasks don't incorrectly reuse previous environments."""
      ray.init()
  
      env_var_name = "TEST123"
      val1 = "VAL1"
      val2 = "VAL2"
      assert os.environ.get(env_var_name) is None
  
      @ray.remote
      def f():
          return os.environ.get(env_var_name)
  
      @ray.remote
      def g():
          return os.environ.get(env_var_name)
  
      assert ray.get(f.remote()) is None
      assert (
          ray.get(
              f.options(
                  runtime_env={"env_vars": {env_var_name: val1}}
              ).remote()
          )
          == val1
      )
      assert ray.get(f.remote()) is None
      assert ray.get(g.remote()) is None
      assert (
          ray.get(
              f.options(
                  runtime_env={"env_vars": {env_var_name: val2}}
              ).remote()
          )
          == val2
      )
      assert ray.get(g.remote()) is None
      assert ray.get(f.remote()) is None
  
file_path: ray/python/ray/tests/test_runtime_env_env_vars.py
imports: import os
  import sys
  import pytest
  import ray
label_desc: Use image node_id 6 for calling a global function with example usage: test_environment_variables_reuse(shutdown_only) and returns: os, os