code: def test_final_obs_info(vectoriser):
      """Tests that the vector environments correctly return the final observation and info."""
  
      def reset_fn(self, seed=None, options=None):
          return 0, {"reset": True}
  
      def thunk():
          return GenericTestEnv(
              action_space=Discrete(4),
              observation_space=Discrete(4),
              reset_fn=reset_fn,
              step_fn=lambda self, action: (
                  action if action < 3 else 0,
                  0,
                  action >= 3,
                  False,
                  {"action": action},
              ),
          )
  
      env = vectoriser([thunk])
      obs, info = env.reset()
      assert obs == np.array([0]) and info == {
          "reset": np.array([True]),
          "_reset": np.array([True]),
      }
  
      obs, _, termination, _, info = env.step([1])
      assert (
          obs == np.array([1])
          and termination == np.array([False])
          and info
          == {"action": np.array([1]), "_action": np.array([True])}
      )
  
      obs, _, termination, _, info = env.step([2])
      assert (
          obs == np.array([2])
          and termination == np.array([False])
          and info
          == {"action": np.array([2]), "_action": np.array([True])}
      )
  
      obs, _, termination, _, info = env.step([3])
      assert (
          obs == np.array([0])
          and termination == np.array([True])
          and info["reset"] == np.array([True])
      )
      assert "final_observation" in info and "final_info" in info
      assert info["final_observation"] == np.array([0]) and info[
          "final_info"
      ] == {"action": 3}
  
file_path: gym/tests/vector/test_vector_env.py
imports: from functools import partial
  import numpy
  import pytest
  from gym.spaces import Discrete, Tuple
  from gym.vector.async_vector_env import AsyncVectorEnv
  from gym.vector.sync_vector_env import SyncVectorEnv
  from gym.vector.vector_env import VectorEnv
  from tests.testing_env import GenericTestEnv
  from tests.vector.utils import CustomSpace, make_env
label_desc: Use image node_id 3 for calling a global function with example usage: test_final_obs_info(vectoriser) and returns: int,  dict, GenericTestEnv