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

CI: correct error msg in test_view_index #58181

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/tests/indexes/numeric/test_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def test_cant_or_shouldnt_cast(self, dtype):

def test_view_index(self, simple_index):
index = simple_index
msg = "Cannot change data-type for object array"
msg = "Cannot change data-type for array of references."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to support both error messages probably as the error messages only changed on the dev build

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I added the previous error message to the new one.

with pytest.raises(TypeError, match=msg):
index.view(Index)

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/ranges/test_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def test_cant_or_shouldnt_cast(self, start, stop, step):

def test_view_index(self, simple_index):
index = simple_index
msg = "Cannot change data-type for object array"
msg = "Cannot change data-type for array of references."
with pytest.raises(TypeError, match=msg):
index.view(Index)

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def test_view_with_args_object_array_raises(self, index):
with pytest.raises(NotImplementedError, match="i8"):
index.view("i8")
else:
msg = "Cannot change data-type for object array"
msg = "Cannot change data-type for array of references."
with pytest.raises(TypeError, match=msg):
index.view("i8")

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/test_datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_view(self, simple_index):
result = type(simple_index)(idx)
tm.assert_index_equal(result, idx)

msg = "Cannot change data-type for object array"
msg = "Cannot change data-type for array of references."
with pytest.raises(TypeError, match=msg):
idx.view(type(simple_index))

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/test_old_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ def test_view(self, simple_index):
idx_view = idx.view(dtype)
tm.assert_index_equal(idx, index_cls(idx_view, name="Foo"), exact=True)

msg = "Cannot change data-type for object array"
msg = "Cannot change data-type for array of references."
with pytest.raises(TypeError, match=msg):
# GH#55709
idx.view(index_cls)
Expand Down