docstr: Tests a old gym.Env (should fail, even with auto-wrapping enabled).
docstr_tok: ["Tests","a","old","gym.Env","(","should","fail",",","even","with","auto-wrapping","enabled",")","."]
code: def test_old_gym_env(self):
      """Tests a old gym.Env (should fail, even with auto-wrapping enabled)."""
  
      def test_():
          (
              PPOConfig()
              .environment(env=OldGymEnv, auto_wrap_old_gym_envs=True)
              # Forces the error to be raised on the local worker so that it is not
              # swallowed by a RayActorError and speeds the test up.
              .rollouts(num_rollout_workers=0)
              .build()
          )
  
      self.assertRaisesRegex(
          ValueError,
          "does not abide to the new gymnasium-style API",
          lambda: test_(),
      )
  
imports: import unittest
  import ray
  from ray.rllib.algorithms.ppo import PPOConfig
  from ray.rllib.env.multi_agent_env import MultiAgentEnv
  from ray.rllib.env.wrappers.multi_agent_env_compatibility import MultiAgentEnvCompatibility
  from ray.rllib.utils.gym import try_import_gymnasium_and_gym
  from ray.tune.registry import register_env
label_desc: Use image node_id 8 for calling the TestGymEnvAPIs obj's underlying member method code with example usage: obj.test_old_gym_env() without return types