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

Fix flakey base setitem test #30660

Merged
merged 1 commit into from
Jan 3, 2020
Merged
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
8 changes: 3 additions & 5 deletions pandas/tests/extension/base/setitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,9 @@ def test_setitem_scalar_key_sequence_raise(self, data):

def test_setitem_preserves_views(self, data):
# GH#28150 setitem shouldn't swap the underlying data
assert data[-1] != data[0] # otherwise test would not be meaningful
Copy link
Member

Choose a reason for hiding this comment

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

if we start with data[0] == data[1] then the assertions below aren't testing anything useful. some of the data fixtures check for a condition similar to this one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We require that they be unequal:

* data[0] and data[1] should not be equal


view1 = data.view()
view2 = data[:]

data[0] = data[-1]
assert view1[0] == data[-1]
assert view2[0] == data[-1]
data[0] = data[1]
assert view1[0] == data[1]
assert view2[0] == data[1]