-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF/TST: Add more pytest idiom to indexing/multiindex/test_iloc.py #24272
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
Hello @simonjayhawkins! Thanks for submitting the PR.
|
Codecov Report
@@ Coverage Diff @@
## master #24272 +/- ##
=======================================
Coverage 92.22% 92.22%
=======================================
Files 162 162
Lines 51785 51785
=======================================
Hits 47758 47758
Misses 4027 4027
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #24272 +/- ##
=======================================
Coverage 92.22% 92.22%
=======================================
Files 162 162
Lines 51785 51785
=======================================
Hits 47758 47758
Misses 4027 4027
Continue to review full report at Codecov.
|
|
||
try: | ||
tm.assert_equal(result, expected) | ||
except NotImplementedError: |
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.
what case hits this? would like to more explict here (e.g. not using a try/except)
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.
@jreback .loc
returns either a series, dataframe or scalar value, the except is for the scalar values. it may be better to split this test into three seperate tests; test_iloc_returns_series
, test_iloc_returns_dataframe
, and test_iloc_returns_scalar
. we would then be duplicating the setup but this could be made a fixture. what's you thoughts?
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.
yes let's do that. i am very leary anytime have a try/except in a test as they often hide actual errors.
thanks! |
git diff upstream/master -u -- "*.py" | flake8 --diff
in this PR:
test_iloc_getitem_multiindex2
. difference in series name resolved. some tests were duplicated intest_iloc_getitem_multiindex
.ix
removed. this was only used to generate expected values. this module is to test.loc
functionality only. integer indexing on the numpy array used to create dataframe used instead.