code: def test_check_information_criterion(
      ic, ooss, expect_error, expect_warning, expected_val
  ):
      if expect_error:
          with pytest.raises(ValueError) as ve:
              val.check_information_criterion(ic, ooss)
          assert (
              "not defined for information_criteria"
              in pytest_error_str(ve)
          )
  
      else:
          if expect_warning:
              with pytest.warns(UserWarning) as w:
                  res = val.check_information_criterion(ic, ooss)
              assert any(
                  "information_criterion cannot be" in s
                  for s in pytest_warning_messages(w)
              )
          else:
              with pytest.warns(None) as w:
                  res = val.check_information_criterion(ic, ooss)
              assert not w
  
          assert expected_val == res
  
file_path: pmdarima/pmdarima/arima/tests/test_validation.py
imports: import numpy
  import pytest
  from pmdarima.compat.pytest import pytest_warning_messages, pytest_error_str
  from pmdarima.arima import _validation
  from pmdarima.warnings import ModelFitWarning
label_desc: Use image node_id 1 for calling a global function with example usage: test_check_information_criterion(ic, ooss, expect_error, expect_warning, expected_val) without return types