code: def test_passive_checker_wrapper_warnings(spec):
      with warnings.catch_warnings(record=True) as caught_warnings:
          env = gym.make(spec)  # disable_env_checker=False
          env.reset()
          env.step(env.action_space.sample())
          # todo, add check for render, bugged due to mujoco v2/3 and v4 envs
  
          env.close()
  
      for warning in caught_warnings:
          if (
              warning.message.args[0]
              not in PASSIVE_CHECK_IGNORE_WARNING
          ):
              raise gym.error.Error(
                  f"Unexpected warning: {warning.message}"
              )
  
imports: import re
  import warnings
  from copy import deepcopy
  import numpy
  import pytest
  import gym
  from gym.envs.classic_control import cartpole
  from gym.wrappers import AutoResetWrapper, HumanRendering, OrderEnforcing, TimeLimit
  from gym.wrappers.env_checker import PassiveEnvChecker
  from tests.envs.test_envs import PASSIVE_CHECK_IGNORE_WARNING
  from tests.envs.utils import all_testing_env_specs
  from tests.envs.utils_envs import ArgumentEnv, RegisterDuringMakeEnv
  from tests.testing_env import GenericTestEnv, old_step_fn
  from tests.wrappers.utils import has_wrapper
label_desc: Use image node_id 7 for calling a global function with example usage: test_passive_checker_wrapper_warnings(spec) without return types