Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Use intp as expected dtype in IntervalIndex indexing tests #23609

Merged
merged 1 commit into from
Nov 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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