def METHOD_NAME(pixels_only):
    pixel_key = "rgb"
    env = FakeDictObservationEnvironment()
    # Make sure we are testing the right environment for the test.
    observation_space = env.observation_space
    assert isinstance(observation_space, spaces.Dict)
    width, height = (320, 240)
    # The wrapper should only add one observation.
    wrapped_env = PixelObservationWrapper(
        env,
        pixel_keys=(pixel_key,),
        pixels_only=pixels_only,
        render_kwargs={pixel_key: {"width": width, "height": height}},
    )
    assert isinstance(wrapped_env.observation_space, spaces.Dict)
    if pixels_only:
        assert len(wrapped_env.observation_space.spaces) == 1
        assert list(wrapped_env.observation_space.spaces.keys()) == [pixel_key]
    else:
        assert (
            len(wrapped_env.observation_space.spaces)
            == len(observation_space.spaces) + 1
        )
        expected_keys = list(observation_space.spaces.keys()) + [pixel_key]
        assert list(wrapped_env.observation_space.spaces.keys()) == expected_keys
    # Check that the added space item is consistent with the added observation.
    observation, info = wrapped_env.reset()
    rgb_observation = observation[pixel_key]
    assert isinstance(info, dict)
    assert rgb_observation.shape == (height, width, 3)
    assert rgb_observation.dtype == np.uint8