Skip to content

Commit 5f16aff

Browse files
VlekSeeminSyed
authored andcommitted
Avoid bare pytest.raises in indexes/categorical/test_indexing.py (pandas-dev#32797)
1 parent 29cc056 commit 5f16aff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/tests/indexes/categorical/test_indexing.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def test_take_fill_value(self):
6565
with pytest.raises(ValueError, match=msg):
6666
idx.take(np.array([1, 0, -5]), fill_value=True)
6767

68-
with pytest.raises(IndexError):
68+
msg = "index -5 is out of bounds for (axis 0 with )?size 3"
69+
with pytest.raises(IndexError, match=msg):
6970
idx.take(np.array([1, -5]))
7071

7172
def test_take_fill_value_datetime(self):
@@ -104,7 +105,8 @@ def test_take_fill_value_datetime(self):
104105
with pytest.raises(ValueError, match=msg):
105106
idx.take(np.array([1, 0, -5]), fill_value=True)
106107

107-
with pytest.raises(IndexError):
108+
msg = "index -5 is out of bounds for (axis 0 with )?size 3"
109+
with pytest.raises(IndexError, match=msg):
108110
idx.take(np.array([1, -5]))
109111

110112
def test_take_invalid_kwargs(self):

0 commit comments

Comments
 (0)