Skip to content

Commit 2175f3e

Browse files
committed
TST: actually test #16877 on numeric index (not just RangeIndex)
1 parent 989f912 commit 2175f3e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/tests/indexes/test_base.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1439,9 +1439,12 @@ def test_get_indexer_strings_raises(self):
14391439
index.get_indexer(['a', 'b', 'c', 'd'], method='pad',
14401440
tolerance=[2, 2, 2, 2])
14411441

1442-
def test_get_indexer_numeric_index_boolean_target(self):
1442+
@pytest.mark.parametrize("idx_class", [Int64Index, RangeIndex,
1443+
Float64Index])
1444+
def test_get_indexer_numeric_index_boolean_target(self, idx_class):
14431445
# GH 16877
1444-
numeric_index = pd.Index(range(4))
1446+
1447+
numeric_index = idx_class(RangeIndex((4)))
14451448
result = numeric_index.get_indexer([True, False, True])
14461449
expected = np.array([-1, -1, -1], dtype=np.intp)
14471450
tm.assert_numpy_array_equal(result, expected)

0 commit comments

Comments
 (0)