code: def test_infer_from_tdi_mismatch(self):
      # GH#23539
      # fast-path for invalidating a frequency if the passed data already
      #  has one and it does not match the `freq` input
      tdi = timedelta_range("1 second", periods=100, freq="1s")
  
      depr_msg = "TimedeltaArray.__init__ is deprecated"
      msg = (
          "Inferred frequency .* from passed values does "
          "not conform to passed frequency"
      )
      with pytest.raises(ValueError, match=msg):
          TimedeltaIndex(tdi, freq="D")
  
      with pytest.raises(ValueError, match=msg):
          # GH#23789
          with tm.assert_produces_warning(
              FutureWarning, match=depr_msg
          ):
              TimedeltaArray(tdi, freq="D")
  
      with pytest.raises(ValueError, match=msg):
          TimedeltaIndex(tdi._data, freq="D")
  
      with pytest.raises(ValueError, match=msg):
          with tm.assert_produces_warning(
              FutureWarning, match=depr_msg
          ):
              TimedeltaArray(tdi._data, freq="D")
  
imports: from datetime import timedelta
  import numpy
  import pytest
  import pandas
  from pandas import Timedelta, TimedeltaIndex, timedelta_range, to_timedelta
  import pandas._testing
  from pandas.core.arrays.timedeltas import TimedeltaArray
label_desc: Use image node_id 6 for calling the TestTimedeltaIndex obj's underlying member method code with example usage: obj.test_infer_from_tdi_mismatch() without return types