Skip to content

Commit

Permalink
TST/CLN: Follow-up to pandas-dev#31867
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins committed Feb 28, 2020
1 parent edcf1c8 commit ebf45b2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions pandas/tests/indexing/test_floats.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,12 @@ def test_scalar_with_mixed(self):
s2 = Series([1, 2, 3], index=["a", "b", "c"])
s3 = Series([1, 2, 3], index=["a", "b", 1.5])

# lookup in a pure stringstr
# with an invalid indexer
msg = (
r"cannot do label indexing "
r"on Index with these indexers \[1\.0\] of "
r"type float|"
"Cannot index by location index with a non-integer key"
)
# lookup in a pure string index with an invalid indexer

with pytest.raises(KeyError, match="^1.0$"):
s2[1.0]

msg = "Cannot index by location index with a non-integer key"
with pytest.raises(TypeError, match=msg):
s2.iloc[1.0]

Expand Down

0 comments on commit ebf45b2

Please sign in to comment.