code: def test_astype_cast_nan_inf_int(self, any_int_numpy_dtype, value):
      # gh-14265: check NaN and inf raise error when converting to int
      msg = (
          "Cannot convert non-finite values \\(NA or inf\\) to integer"
      )
      ser = Series([value])
  
      with pytest.raises(ValueError, match=msg):
          ser.astype(any_int_numpy_dtype)
  
imports: from datetime import datetime, timedelta
  from importlib import reload
  import string
  import sys
  import numpy
  import pytest
  from pandas._libs.tslibs import iNaT
  import pandas.util._test_decorators
  from pandas import NA, Categorical, CategoricalDtype, DatetimeTZDtype, Index, Interval, NaT, Series, Timedelta, Timestamp, cut, date_range, to_datetime
  import pandas._testing
label_desc: Use image node_id 20 for calling the TestAstype obj's underlying member method code with example usage: obj.test_astype_cast_nan_inf_int(any_int_numpy_dtype, value) without return types