code: def test_gymnasium_wrapper():
      print(
          "Testing Gymnasium wrapper compatibility with gymnasium API"
      )
      for env_name in vizdoom_envs:
          # Skip environments with animated textures,
          # as they might render different states for the same seeds
          if env_name.split("-")[0] in envs_with_animated_textures:
              continue
  
          for frame_skip in [1, 4]:
              env = gymnasium.make(
                  env_name, frame_skip=frame_skip, max_buttons_pressed=0
              )
  
              # Test if env adheres to Gymnasium API
              check_env(env.unwrapped, skip_render_check=True)
  
              ob_space = env.observation_space
              act_space = env.action_space
              obs, _ = env.reset()
              assert ob_space.contains(
                  obs
              ), f"Reset observation: {obs!r} not in space"
  
              a = act_space.sample()
              (
                  observation,
                  reward,
                  terminated,
                  truncated,
                  _info,
              ) = env.step(a)
              assert ob_space.contains(
                  observation
              ), f"Step observation: {observation!r} not in space"
              assert np.isscalar(
                  reward
              ), f"{reward} is not a scalar for {env}"
              assert isinstance(
                  terminated, bool
              ), f"Expected {terminated} to be a boolean"
              assert isinstance(
                  truncated, bool
              ), f"Expected {truncated} to be a boolean"
  
              env.close()
  
file_path: ViZDoom/tests/test_gymnasium_wrapper.py
imports: import os
  import pickle
  import gymnasium
  import numpy
  from gymnasium.spaces import Box, Dict, Discrete, MultiDiscrete
  from gymnasium.utils.env_checker import check_env, data_equivalence
  from vizdoom import gymnasium_wrapper
  from vizdoom.gymnasium_wrapper.base_gymnasium_env import VizdoomEnv
label_desc: Use image node_id 1 for calling a global function with example usage: test_gymnasium_wrapper() without return types