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: GH30999 Change all pytest.raises in pandas/tests/indexing to tm.external_error_raised #38825

Merged
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions pandas/tests/indexing/multiindex/test_partial.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ def test_partial_loc_missing(self, multiindex_year_month_day_dataframe_random_da
# assert (self.ymd.loc[2000]['A'] == 0).all()

# Pretty sure the second (and maybe even the first) is already wrong.
with pytest.raises(Exception):
with pytest.raises(KeyError, match="6"):
ymd.loc[(2000, 6)]
with pytest.raises(Exception):
with pytest.raises(KeyError, match="(2000, 6)"):
ymd.loc[(2000, 6), 0]

# ---------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/indexing/test_coercion.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ def test_setitem_index_float64(self, val, exp_dtype, request):
if exp_dtype is IndexError:
# float + int -> int
temp = obj.copy()
with pytest.raises(exp_dtype):
msg = "index 5 is out of bounds for axis 0 with size 4"
with pytest.raises(exp_dtype, match=msg):
temp[5] = 5
mark = pytest.mark.xfail(reason="TODO_GH12747 The result must be float")
request.node.add_marker(mark)
Expand Down