class_docstr: A generic testing environment for use in testing with modified environments are required.
class_docstr_tok: ["A","generic","testing","environment","for","use","in","testing","with","modified","environments","are","required","."]
code: def __init__(
      self,
      action_space: spaces.Space = spaces.Box(0, 1, (1,)),
      observation_space: spaces.Space = spaces.Box(0, 1, (1,)),
      reset_fn: callable = basic_reset_fn,
      step_fn: callable = new_step_fn,
      render_fn: callable = basic_render_fn,
      metadata: Optional[Dict[str, Any]] = None,
      render_mode: Optional[str] = None,
      spec: EnvSpec = EnvSpec(
          "TestingEnv-v0", "testing-env-no-entry-point"
      ),
  ):
      self.metadata = {} if metadata is None else metadata
      self.render_mode = render_mode
      self.spec = spec
  
      if observation_space is not None:
          self.observation_space = observation_space
      if action_space is not None:
          self.action_space = action_space
  
      if reset_fn is not None:
          self.reset = types.MethodType(reset_fn, self)
      if step_fn is not None:
          self.step = types.MethodType(step_fn, self)
      if render_fn is not None:
          self.render = types.MethodType(render_fn, self)
  
file_path: gym/tests/testing_env.py
imports: import types
  from typing import Any, Dict, Optional, Tuple, Union
  import gym
  from gym import spaces
  from gym.core import ActType, ObsType
  from gym.envs.registration import EnvSpec
label_desc: Use image node_id 1 to create a new GenericTestEnv object from inherited base classes: gym with example: obj = GenericTestEnv(action_space, observation_space, reset_fn, step_fn, render_fn, metadata, render_mode, spec)