Skip to content

Commit f2a1325

Browse files
TST: broken off from #32187 (#32258)
Co-authored-by: Simon Hawkins <[email protected]>
1 parent bdcb5da commit f2a1325

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

pandas/tests/indexing/test_floats.py

+3-18
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,7 @@ def check(self, result, original, indexer, getitem):
4040

4141
tm.assert_almost_equal(result, expected)
4242

43-
@pytest.mark.parametrize(
44-
"index_func",
45-
[
46-
tm.makeStringIndex,
47-
tm.makeUnicodeIndex,
48-
tm.makeCategoricalIndex,
49-
tm.makeDateIndex,
50-
tm.makeTimedeltaIndex,
51-
tm.makePeriodIndex,
52-
tm.makeIntIndex,
53-
tm.makeRangeIndex,
54-
],
55-
)
56-
def test_scalar_error(self, index_func):
43+
def test_scalar_error(self, series_with_simple_index):
5744

5845
# GH 4892
5946
# float_indexers should raise exceptions
@@ -62,11 +49,9 @@ def test_scalar_error(self, index_func):
6249
# but is specifically testing for the error
6350
# message
6451

65-
i = index_func(5)
52+
s = series_with_simple_index
6653

67-
s = Series(np.arange(len(i)), index=i)
68-
69-
msg = "Cannot index by location index"
54+
msg = "Cannot index by location index with a non-integer key"
7055
with pytest.raises(TypeError, match=msg):
7156
s.iloc[3.0]
7257

0 commit comments

Comments
 (0)