code: def test_too_small_categorical_grid(caplog):
      """Test that small categorical grid returns all choices"""
      dim = Categorical("yolo", "abcde")
      with caplog.at_level(
          logging.WARNING, logger="orion.algo.gridsearch"
      ):
          assert categorical_grid(dim, 7) == dim.categories
      assert (
          "Categorical dimension yolo does not have 7 choices"
          in caplog.text
      )
  
imports: from __future__ import annotations
  import logging
  import numpy.testing
  import pytest
  from orion.algo.gridsearch import GridSearch, categorical_grid, discrete_grid, grid, real_grid
  from orion.algo.space import Categorical, Integer, Real, Space
  from orion.testing.algo import BaseAlgoTests
label_desc: Use image node_id 3 for calling a global function with example usage: test_too_small_categorical_grid(caplog) without return types