code: def test_astype_nan_to_int(self, cls, values):
      # GH#28406
      obj = cls(values)
  
      msg = "Cannot (cast|convert)"
      with pytest.raises((ValueError, TypeError), match=msg):
          obj.astype(int)
  
file_path: pandas/pandas/tests/arrays/categorical/test_astype.py
imports: import numpy
  import pytest
  from pandas import Categorical, CategoricalDtype, CategoricalIndex, DatetimeIndex, Interval, NaT, Period, Timestamp, array, to_datetime
  import pandas._testing
label_desc: Use image node_id 1 for calling the TestAstype obj's underlying member method code with example usage: obj.test_astype_nan_to_int(cls, values) without return types