code: def test_pass_non_dt64_array(self):
      # check that we raise, not segfault
      arr = np.arange(5)
      dtype = np.dtype("M8[ns]")
  
      msg = (
          "astype_overflowsafe values.dtype and dtype must be either "
          "both-datetime64 or both-timedelta64"
      )
      with pytest.raises(TypeError, match=msg):
          astype_overflowsafe(arr, dtype, copy=True)
  
      with pytest.raises(TypeError, match=msg):
          astype_overflowsafe(arr, dtype, copy=False)
  
file_path: pandas/pandas/tests/tslibs/test_np_datetime.py
imports: import numpy
  import pytest
  from pandas._libs.tslibs.dtypes import NpyDatetimeUnit
  from pandas._libs.tslibs.np_datetime import OutOfBoundsDatetime, OutOfBoundsTimedelta, astype_overflowsafe, is_unitless, py_get_unit_from_dtype, py_td64_to_tdstruct
  import pandas._testing
label_desc: Use image node_id 1 for calling the TestAstypeOverflowSafe obj's underlying member method code with example usage: obj.test_pass_non_dt64_array() without return types