Skip to content

Commit

Permalink
TST: Use intp as expected dtype in IntervalIndex indexing tests (pand…
Browse files Browse the repository at this point in the history
  • Loading branch information
jschendel authored and Pingviinituutti committed Feb 28, 2019
1 parent 9bdc082 commit 6f56203
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pandas/tests/indexes/interval/test_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,9 @@ def test_get_loc_value(self):
assert idx.get_loc(0.5) == 0
assert idx.get_loc(1) == 0
tm.assert_numpy_array_equal(idx.get_loc(1.5),
np.array([0, 1], dtype='int64'))
np.array([0, 1], dtype='intp'))
tm.assert_numpy_array_equal(np.sort(idx.get_loc(2)),
np.array([0, 1], dtype='int64'))
np.array([0, 1], dtype='intp'))
assert idx.get_loc(3) == 1
pytest.raises(KeyError, idx.get_loc, 3.5)

Expand Down Expand Up @@ -537,12 +537,12 @@ def test_get_loc_datetimelike_overlapping(self, arrays):

value = index[0].mid + Timedelta('12 hours')
result = np.sort(index.get_loc(value))
expected = np.array([0, 1], dtype='int64')
expected = np.array([0, 1], dtype='intp')
assert tm.assert_numpy_array_equal(result, expected)

interval = Interval(index[0].left, index[1].right)
result = np.sort(index.get_loc(interval))
expected = np.array([0, 1, 2], dtype='int64')
expected = np.array([0, 1, 2], dtype='intp')
assert tm.assert_numpy_array_equal(result, expected)

# To be removed, replaced by test_interval_new.py (see #16316, #16386)
Expand Down Expand Up @@ -617,7 +617,7 @@ def test_get_reindexer_datetimelike(self, arrays):
target = IntervalIndex.from_tuples(tuples)

result = index._get_reindexer(target)
expected = np.array([0, 3], dtype='int64')
expected = np.array([0, 3], dtype='intp')
tm.assert_numpy_array_equal(result, expected)

@pytest.mark.parametrize('breaks', [
Expand Down

0 comments on commit 6f56203

Please sign in to comment.