Skip to content

TST: Updated tests for df.where() function in light of new exceptions #56496

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

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion pandas/tests/frame/indexing/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_getitem_boolean(self, mixed_float_frame, mixed_int_frame, datetime_fram
subframe_obj = datetime_frame[indexer_obj]
tm.assert_frame_equal(subframe_obj, subframe)

with pytest.raises(ValueError, match="Boolean array expected"):
with pytest.raises(TypeError, match="Boolean array expected"):
datetime_frame[datetime_frame]

# test that Series work
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/frame/indexing/test_where.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def test_where_invalid_input_single(self, cond):
df = DataFrame({"a": [1, 2, 3]})
msg = "Boolean array expected for the condition"

with pytest.raises(ValueError, match=msg):
with pytest.raises(TypeError, match=msg):
df.where(cond)

@pytest.mark.parametrize(
Expand All @@ -272,7 +272,7 @@ def test_where_invalid_input_multiple(self, cond):
df = DataFrame({"a": [1, 2, 3], "b": [2, 2, 2]})
msg = "Boolean array expected for the condition"

with pytest.raises(ValueError, match=msg):
with pytest.raises(TypeError, match=msg):
df.where(cond)

def test_where_dataframe_col_match(self):
Expand Down