code: def test_check_y_exception_when_y_has_missing_values():
      """
      Check exception is raised when y has missing values.
      """
      err_msg = re.escape("`y` has missing values.")
      with pytest.raises(ValueError, match=err_msg):
          check_y(pd.Series([0, 1, None]))
  
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.utils import check_y
label_desc: Use image node_id 2 for calling a global function with example usage: test_check_y_exception_when_y_has_missing_values() without return types