code: def test_incorrect_dtype_raises(self):
      depr_msg = "DatetimeArray.__init__ is deprecated"
      with tm.assert_produces_warning(FutureWarning, match=depr_msg):
          with pytest.raises(
              ValueError, match="Unexpected value for 'dtype'."
          ):
              DatetimeArray(
                  np.array([1, 2, 3], dtype="i8"), dtype="category"
              )
  
      with tm.assert_produces_warning(FutureWarning, match=depr_msg):
          with pytest.raises(
              ValueError, match="Unexpected value for 'dtype'."
          ):
              DatetimeArray(
                  np.array([1, 2, 3], dtype="i8"), dtype="m8[s]"
              )
  
      with tm.assert_produces_warning(FutureWarning, match=depr_msg):
          with pytest.raises(
              ValueError, match="Unexpected value for 'dtype'."
          ):
              DatetimeArray(
                  np.array([1, 2, 3], dtype="i8"), dtype="M8[D]"
              )
  
imports: import numpy
  import pytest
  from pandas._libs import iNaT
  from pandas.core.dtypes.dtypes import DatetimeTZDtype
  import pandas
  import pandas._testing
  from pandas.core.arrays import DatetimeArray
label_desc: Use image node_id 9 for calling the TestDatetimeArrayConstructor obj's underlying member method code with example usage: obj.test_incorrect_dtype_raises() without return types