TST: Use intp as expected dtype in IntervalIndex indexing tests
State: closed

xref https://github.com/pandas-dev/pandas/pull/23468#issuecomment-437335512: fixes some failing 32bit tests

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Interval
description: Interval data type
name: 32bit
description: 32-bit systems

Comments:
Hello @jschendel! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/tests/indexes/interval/test_interval.py`](https://github.com/jschendel/pandas/blob/342efad5db8e7a8eb73be5025246b013f6b87e12/pandas/tests/indexes/interval/test_interval.py) !


# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23609?src=pr&el=h1) Report
> Merging [#23609](https://codecov.io/gh/pandas-dev/pandas/pull/23609?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/9179e633b1e54ac31c5ea42ec0ec24e9a1709aae?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/23609/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/23609?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #23609   +/-   ##
=======================================
  Coverage   92.25%   92.25%           
=======================================
  Files         161      161           
  Lines       51260    51260           
=======================================
  Hits        47290    47290           
  Misses       3970     3970
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.63% <ø> (ø)` | :arrow_up: |
| #single | `42.33% <ø> (ø)` | :arrow_up: |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23609?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23609?src=pr&el=footer). Last update [9179e63...342efad](https://codecov.io/gh/pandas-dev/pandas/pull/23609?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

thanks
https://travis-ci.org/MacPython/pandas-wheels/jobs/453170919

it’s possible this ran before the merge or it’s still broken
>it’s possible this ran before the merge or it’s still broken

I think it ran before the merge.  The `expected` in the failure message still has `dtype='int64'`, which should have been changed to `'intp'` if the merge had happened.

<pre>

______ TestIntervalIndex.test_get_reindexer_datetimelike[datetime64[ns]] _______
self = <pandas.tests.indexes.interval.test_interval.TestIntervalIndex object at 0xe23a258c>
arrays = (DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04'], dtype='datetime64[ns]', freq='D'), DatetimeIndex(['2018-01-03', '2018-01-04', '2018-01-05', '2018-01-06'], dtype='datetime64[ns]', freq='D'))
    @pytest.mark.parametrize('arrays', [
        (date_range('20180101', periods=4), date_range('20180103', periods=4)),
        (date_range('20180101', periods=4, tz='US/Eastern'),
         date_range('20180103', periods=4, tz='US/Eastern')),
        (timedelta_range('0 days', periods=4),
         timedelta_range('2 days', periods=4))], ids=lambda x: str(x[0].dtype))
    def test_get_reindexer_datetimelike(self, arrays):
        # GH 20636
        index = IntervalIndex.from_arrays(*arrays)
        tuples = [(index[0].left, index[0].left + pd.Timedelta('12H')),
                  (index[-1].right - pd.Timedelta('12H'), index[-1].right)]
        target = IntervalIndex.from_tuples(tuples)
    
        result = index._get_reindexer(target)
<b><i>        expected = np.array([0, 3], dtype='int64')</b></i> 
>       tm.assert_numpy_array_equal(result, expected)
E       AssertionError: numpy array are different
E       
E       Attribute "dtype" are different
E       [left]:  int32
E       [right]: int64

</pre>
https://travis-ci.org/MacPython/pandas-wheels/jobs/453459214

some more