code: def test_format_datetime_with_time(self):
      dti = DatetimeIndex(
          [datetime(2012, 2, 7), datetime(2012, 2, 7, 23)]
      )
  
      msg = "DatetimeIndex.format is deprecated"
      with tm.assert_produces_warning(FutureWarning, match=msg):
          result = dti.format()
      expected = ["2012-02-07 00:00:00", "2012-02-07 23:00:00"]
      assert len(result) == 2
      assert result == expected
  
imports: from datetime import datetime
  import dateutil.tz
  import numpy
  import pytest
  import pytz
  import pandas
  from pandas import DatetimeIndex, NaT, Series
  import pandas._testing
label_desc: Use image node_id 3 for calling the TestFormat obj's underlying member method code with example usage: obj.test_format_datetime_with_time() without return types