-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TST: split up pandas/tests/test_multilevel.py #23797
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.
|
ok, can you merge master. i think something is failing as well (the 2.7 should not be a problem any longer). ideally also see if you can move other indexing tests (that you commented about above), even if you have to slightly duplicate whats in the the base class (but do it as fixtures). |
could have been zip or range... now added to |
you need to isort imports |
from pandas.tests.indexing.common import _mklbl | ||
from pandas.util import testing as tm | ||
|
||
|
||
@pytest.fixture | ||
def frame(): |
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.
i had left some comments on the fixture names
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.
sorry @jreback , either i'm not looking at the right comment or i've misunderstood something. can you clarify?
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, can you give these meaningful names (and a comment on what they are creating)
Codecov Report
@@ Coverage Diff @@
## master #23797 +/- ##
=======================================
Coverage 92.28% 92.28%
=======================================
Files 161 161
Lines 51500 51500
=======================================
Hits 47528 47528
Misses 3972 3972
Continue to review full report at Codecov.
|
pandas/tests/test_multilevel.py
Outdated
result = s[(x > 0 for x in s)] | ||
expected = s[s > 0] | ||
tm.assert_series_equal(result, expected) | ||
|
||
def test_series_setitem(self): |
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.
is there a reason these are not moving?
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.
i've only moved things that have test names that match getitem
or xs
.
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.
you can move setitem as well
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.
- test_get_loc_single_level
- test_fancy_slice_partial
- test_partial_set
- test_partial_ix_missing
- test_int_series_slicing
- test_mixed_depth_get
- test_mixed_depth_insert
- test_dataframe_insert_column_all_na
- test_set_column_scalar_with_ix
- test_indexing_ambiguity_bug_1678
- test_nonunique_assignment_1750
- test_indexing_over_hashtable_size_cutoff
- test_iloc_mi
as well as the tests with names that match setitem?
yes anything that looks like an indexing tesr |
thanks @simonjayhawkins |
it might make sense to now split pandas/tests/indexing/test_multiindex -> pandas/test/indexing/multiindex/ with a series of files under multiindex logically split. |
@jreback i recall seeing some discussion on moving towards the functional idiom of pytest but can't seem to find it. i'll raise a follow on PR and on splitting the test i'll drop the classes as has been done in https://github.com/pandas-dev/pandas/blob/master/pandas/tests/arrays/test_period.py |
git diff upstream/master -u -- "*.py" | flake8 --diff
@jreback
frame
andymd
instead of copying across the test base class.getitem
from theTestSorted
class.test_getitem_int
renamed to _frame to avoid clash with fixture.