code: def test_make_max_episode_steps():
      # Default, uses the spec's
      env = gym.make("CartPole-v1", disable_env_checker=True)
      assert has_wrapper(env, TimeLimit)
      assert (
          env.spec.max_episode_steps
          == gym.envs.registry["CartPole-v1"].max_episode_steps
      )
      env.close()
  
      # Custom max episode steps
      env = gym.make(
          "CartPole-v1", max_episode_steps=100, disable_env_checker=True
      )
      assert has_wrapper(env, TimeLimit)
      assert env.spec.max_episode_steps == 100
      env.close()
  
      # Env spec has no max episode steps
      assert gym.spec("test.ArgumentEnv-v0").max_episode_steps is None
      env = gym.make(
          "test.ArgumentEnv-v0",
          arg1=None,
          arg2=None,
          arg3=None,
          disable_env_checker=True,
      )
      assert has_wrapper(env, TimeLimit) is False
      env.close()
  
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 3 for calling a global function with example usage: test_make_max_episode_steps() without return types