code: def test_autoreset_wrapper_autoreset():
      """Tests the autoreset wrapper actually automatically resets correctly."""
      env = DummyResetEnv()
      env = AutoResetWrapper(env)
  
      obs, info = env.reset()
      assert obs == np.array([0])
      assert info == {"count": 0}
  
      action = 0
      obs, reward, terminated, truncated, info = env.step(action)
      assert obs == np.array([1])
      assert reward == 0
      assert (terminated or truncated) is False
      assert info == {"count": 1}
  
      obs, reward, terminated, truncated, info = env.step(action)
      assert obs == np.array([2])
      assert (terminated or truncated) is False
      assert reward == 0
      assert info == {"count": 2}
  
      obs, reward, terminated, truncated, info = env.step(action)
      assert obs == np.array([0])
      assert (terminated or truncated) is True
      assert reward == 1
      assert info == {
          "count": 0,
          "final_observation": np.array([3]),
          "final_info": {"count": 3},
      }
  
      obs, reward, terminated, truncated, info = env.step(action)
      assert obs == np.array([1])
      assert reward == 0
      assert (terminated or truncated) is False
      assert info == {"count": 1}
  
      env.close()
  
file_path: gym/tests/wrappers/test_autoreset.py
imports: from typing import Generator, Optional
  from unittest.mock import MagicMock
  import numpy
  import pytest
  import gym
  from gym.wrappers import AutoResetWrapper
  from tests.envs.utils import all_testing_env_specs
label_desc: Use image node_id 4 for calling a global function with example usage: test_autoreset_wrapper_autoreset() without return types