docstr: Tests a gymnasium Env that uses the old API.
docstr_tok: ["Tests","a","gymnasium","Env","that","uses","the","old","API","."]
code: def test_gymnasium_old_api(self):
      """Tests a gymnasium Env that uses the old API."""
  
      def test_():
          (
              PPOConfig()
              .environment(
                  env=GymnasiumOldAPI, auto_wrap_old_gym_envs=False
              )
              # 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,
          ".*In particular, the `reset\\(\\)` method seems to be faulty..*",
          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 3 for calling the TestGymEnvAPIs obj's underlying member method code with example usage: obj.test_gymnasium_old_api() without return types