@pytest.mark.parametrize('fill_val,exp_dtype', [(pd.Timestamp('2012-01-01'), 'datetime64[ns]'), (pd.Timestamp('2012-01-01', tz='US/Eastern'), 'datetime64[ns, US/Eastern]')], ids=['datetime64', 'datetime64tz'])
@pytest.mark.parametrize('insert_value', [pd.Timestamp('2012-01-01'), pd.Timestamp('2012-01-01', tz='Asia/Tokyo'), 1])
def test_insert_index_datetimes(self, request, fill_val, exp_dtype, insert_value):
    obj = pd.DatetimeIndex(['2011-01-01', '2011-01-02', '2011-01-03', '2011-01-04'], tz=fill_val.tz)
    assert (obj.dtype == exp_dtype)
    exp = pd.DatetimeIndex(['2011-01-01', fill_val.date(), '2011-01-02', '2011-01-03', '2011-01-04'], tz=fill_val.tz)
    self._assert_insert_conversion(obj, fill_val, exp, exp_dtype)
    if fill_val.tz:
        ts = pd.Timestamp('2012-01-01')
        result = obj.insert(1, ts)
        expected = obj.astype(object).insert(1, ts)
        assert (expected.dtype == object)
        tm.assert_index_equal(result, expected)
        ts = pd.Timestamp('2012-01-01', tz='Asia/Tokyo')
        result = obj.insert(1, ts)
        expected = obj.astype(object).insert(1, ts)
        assert (expected.dtype == object)
        tm.assert_index_equal(result, expected)
    else:
        ts = pd.Timestamp('2012-01-01', tz='Asia/Tokyo')
        result = obj.insert(1, ts)
        expected = obj.astype(object).insert(1, ts)
        assert (expected.dtype == object)
        tm.assert_index_equal(result, expected)
    item = 1
    result = obj.insert(1, item)
    expected = obj.astype(object).insert(1, item)
    assert (expected[1] == item)
    assert (expected.dtype == object)
    tm.assert_index_equal(result, expected)
@pytest.mark.parametrize('fill_val,exp_dtype', [(pd.Timestamp('2012-01-01'), 'datetime64[ns]'), (pd.Timestamp('2012-01-01', tz='US/Eastern'), 'datetime64[ns, US/Eastern]')], ids=['datetime64', 'datetime64tz'])
@pytest.mark.parametrize('insert_value', [pd.Timestamp('2012-01-01'), pd.Timestamp('2012-01-01', tz='Asia/Tokyo'), 1])
def test_insert_index_datetimes(self, request, fill_val, exp_dtype, insert_value):
    obj = pd.DatetimeIndex(['2011-01-01', '2011-01-02', '2011-01-03', '2011-01-04'], tz=fill_val.tz)
    assert (obj.dtype == exp_dtype)
    exp = pd.DatetimeIndex(['2011-01-01', fill_val.date(), '2011-01-02', '2011-01-03', '2011-01-04'], tz=fill_val.tz)
    self._assert_insert_conversion(obj, fill_val, exp, exp_dtype)
    if fill_val.tz:
        ts = pd.Timestamp('2012-01-01')
        result = obj.insert(1, ts)
        expected = obj.astype(object).insert(1, ts)
        assert (expected.dtype == object)
        tm.assert_index_equal(result, expected)
        ts = pd.Timestamp('2012-01-01', tz='Asia/Tokyo')
        result = obj.insert(1, ts)
        expected = obj.astype(object).insert(1, ts)
        assert (expected.dtype == object)
        tm.assert_index_equal(result, expected)
    else:
        ts = pd.Timestamp('2012-01-01', tz='Asia/Tokyo')
        result = obj.insert(1, ts)
        expected = obj.astype(object).insert(1, ts)
        assert (expected.dtype == object)
        tm.assert_index_equal(result, expected)
    item = 1
    result = obj.insert(1, item)
    expected = obj.astype(object).insert(1, item)
    assert (expected[1] == item)
    assert (expected.dtype == object)
    tm.assert_index_equal(result, expected)