-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
TST: Reduce deep copies in the test suite #62970
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
Conversation
| def test_to_xarray_index_types(self, index_flat, request): | ||
| # MultiIndex is tested in test_to_xarray_with_multiindex | ||
| index = index_flat | ||
| index = index_flat.copy(deep=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a super-strong opinion, but needing to do this as a policy feels weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK sure I can remove this case, but generally I feel like always some risk mutating a pytest fixture
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, I won’t complain
|
thanks @mroeschke |
Since most of the fixtures documentation that a copy is made to avoid changing attributes of Index/Series, a shallow copy should just be necessary instead of using a deep copy. But IMO tests should not be mutating fixtures