code: def test_check_m(
      m, seasonal, expect_error, expect_warning, expected_val
  ):
      if expect_error:
          with pytest.raises(ValueError) as ve:
              val.check_m(m, seasonal)
          assert "must be a positive integer" in pytest_error_str(ve)
  
      else:
          if expect_warning:
              with pytest.warns(UserWarning) as w:
                  res = val.check_m(m, seasonal)
              assert any(
                  "set for non-seasonal fit" in s
                  for s in pytest_warning_messages(w)
              )
          else:
              with pytest.warns(None) as w:
                  res = val.check_m(m, seasonal)
              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 3 for calling a global function with example usage: test_check_m(m, seasonal, expect_error, expect_warning, expected_val) without return types