docstr: Expect the env pre-checking to fail on each worker.
docstr_tok: ["Expect","the","env","pre-checking","to","fail","on","each","worker","."]
code: def test_crash_during_env_pre_checking(self):
      """Expect the env pre-checking to fail on each worker."""
      config = (
          PPOConfig()
          .rollouts(num_rollout_workers=2, num_envs_per_worker=4)
          .environment(
              env=CartPoleCrashing,
              env_config={
                  # Crash prob=100% (during pre-checking's `step()` test calls).
                  "p_crash": 1.0,
                  "init_time_s": 0.5,
              },
          )
      )
      # Expect ValueError due to pre-checking failing (our pre-checker module
      # raises a ValueError if `step()` fails).
      self.assertRaisesRegex(
          ValueError,
          "Simulated env crash",
          lambda: config.build(),
      )
  
file_path: ray/python/ray/rllib/evaluation/tests/test_envs_that_crash.py
imports: import unittest
  import ray
  from ray.rllib.algorithms.pg import PGConfig
  from ray.rllib.algorithms.ppo import PPOConfig
  from ray.rllib.algorithms.tests.test_worker_failures import ForwardHealthCheckToEnvWorker
  from ray.rllib.examples.env.cartpole_crashing import CartPoleCrashing
  from ray.rllib.utils.error import EnvError
label_desc: Use image node_id 3 for calling the TestEnvsThatCrash obj's underlying member method code with example usage: obj.test_crash_during_env_pre_checking() without return types