code: def test_astype_int(dtype):
      arr = pd.array(["1", "2", "3"], dtype=dtype)
      result = arr.astype("int64")
      expected = np.array([1, 2, 3], dtype="int64")
      tm.assert_numpy_array_equal(result, expected)
  
      arr = pd.array(["1", pd.NA, "3"], dtype=dtype)
      if dtype.storage == "pyarrow_numpy":
          err = ValueError
          msg = "cannot convert float NaN to integer"
      else:
          err = TypeError
          msg = (
              r"int\(\) argument must be a string, a bytes-like "
              r"object or a( real)? number"
          )
      with pytest.raises(err, match=msg):
          arr.astype("int64")
  
imports: import operator
  import numpy
  import pytest
  from pandas.compat.pyarrow import pa_version_under12p0
  from pandas.core.dtypes.common import is_dtype_equal
  import pandas
  import pandas._testing
  from pandas.core.arrays.string_arrow import ArrowStringArray, ArrowStringArrayNumpySemantics
label_desc: Use image node_id 23 for calling a global function with example usage: test_astype_int(dtype) without return types