code: def test_remote_package_uri(
      start_cluster, remote_uri, option, per_task_actor
  ):
      """Tests the case where we lazily read files or import inside a task/actor.
  
      In this case, the files come from a remote location.
  
      This tests both that this fails *without* the working_dir and that it
      passes with it.
      """
      cluster, address = start_cluster
  
      if option == "working_dir":
          if remote_uri.endswith(".whl"):
              pytest.skip(".whl working dir is not supported")
          env = {"working_dir": remote_uri}
      elif option == "py_modules":
          env = {"py_modules": [remote_uri]}
  
      if option == "failure" or per_task_actor:
          ray.init(address)
      else:
          ray.init(address, runtime_env=env)
  
      @ray.remote
      def test_import():
          import test_module
  
          return test_module.one()
  
      if option != "failure" and per_task_actor:
          test_import = test_import.options(runtime_env=env)
  
      if option == "failure":
          with pytest.raises(ImportError):
              ray.get(test_import.remote())
      else:
          assert ray.get(test_import.remote()) == 2
  
      @ray.remote
      class Actor:
          def test_import(self):
              import test_module
  
              return test_module.one()
  
      if option != "failure" and per_task_actor:
          Actor = Actor.options(runtime_env=env)
  
      a = Actor.remote()
      if option == "failure":
          with pytest.raises(ImportError):
              assert ray.get(a.test_import.remote()) == 2
      else:
          assert ray.get(a.test_import.remote()) == 2
  
file_path: ray/python/ray/tests/test_runtime_env_working_dir_remote_uri.py
imports: from pathlib import Path
  import sys
  import pytest
  from pytest_lazyfixture import lazy_fixture
  import ray
label_desc: Use image node_id 1 for calling a global function with example usage: test_remote_package_uri(start_cluster, remote_uri, option, per_task_actor) and returns: test_module, test_module