docstr: Tests a gymnasium Env that uses the new API, but errors on reset() call.
docstr_tok: ["Tests","a","gymnasium","Env","that","uses","the","new","API",",","but","errors","on","reset","(",")","call","."]
code: def test_gymnasium_new_api_but_throws_error_on_reset(self):
      """Tests a gymnasium Env that uses the new API, but errors on reset() call."""
  
      def test_():
          (
              PPOConfig()
              .environment(
                  GymnasiumNewAPIButThrowsErrorOnReset,
                  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(AssertionError, "kaboom!", 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 6 for calling the TestGymEnvAPIs obj's underlying member method code with example usage: obj.test_gymnasium_new_api_but_throws_error_on_reset() without return types