-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TST: More pytest idioms in tests/generic #45086
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
mroeschke
commented
Dec 28, 2021
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
pandas/tests/generic/test_generic.py
Outdated
else: | ||
arr = np.empty(shape, dtype=dtype) | ||
arr.fill(value) | ||
def check_metadata(x, y=None): |
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.
can you move this to _testing? and call it assert_metadata or similar (doc-string & typing if you can)
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.
request for followup
@@ -1470,3 +1470,15 @@ def assert_indexing_slices_equivalent(ser: Series, l_slc: slice, i_slc: slice): | |||
if not ser.index.is_integer(): | |||
# For integer indices, .loc and plain getitem are position-based. | |||
assert_series_equal(ser[l_slc], expected) | |||
|
|||
|
|||
def assert_metadata_equivalent(left, right): |
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.
ideally type these (followup ok)
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.
these have to be Series/DataFrame?
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.
also see if you can grep if we have any more _metadata checkers