Skip to content

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

Merged
merged 9 commits into from
Nov 23, 2018

Conversation

simonjayhawkins
Copy link
Member

@jreback

  1. i've used fixtures for frame and ymd instead of copying across the test base class.
  2. not moved tests with names matching getitem from the TestSorted class.
  3. frame used in test_getitem_int renamed to _frame to avoid clash with fixture.

@pep8speaks
Copy link

Hello @simonjayhawkins! Thanks for submitting the PR.

@jreback
Copy link
Contributor

jreback commented Nov 20, 2018

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).

@jreback jreback added Testing pandas testing functions or related to the test suite Clean labels Nov 20, 2018
@simonjayhawkins
Copy link
Member Author

i think something is failing as well (the 2.7 should not be a problem any longer)

could have been zip or range... now added to from pandas.compat ...

@jreback
Copy link
Contributor

jreback commented Nov 21, 2018

you need to isort imports

from pandas.tests.indexing.common import _mklbl
from pandas.util import testing as tm


@pytest.fixture
def frame():
Copy link
Contributor

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

Copy link
Member Author

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?

Copy link
Contributor

@jreback jreback Nov 21, 2018

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
Copy link

codecov bot commented Nov 21, 2018

Codecov Report

Merging #23797 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #23797   +/-   ##
=======================================
  Coverage   92.28%   92.28%           
=======================================
  Files         161      161           
  Lines       51500    51500           
=======================================
  Hits        47528    47528           
  Misses       3972     3972
Flag Coverage Δ
#multiple 90.68% <ø> (ø) ⬆️
#single 42.31% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20ae454...68b7141. Read the comment docs.

result = s[(x > 0 for x in s)]
expected = s[s > 0]
tm.assert_series_equal(result, expected)

def test_series_setitem(self):
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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

Copy link
Member Author

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?

@jreback
Copy link
Contributor

jreback commented Nov 22, 2018

yes anything that looks like an indexing tesr

@jreback jreback added this to the 0.24.0 milestone Nov 23, 2018
@jreback jreback merged commit e5c90e5 into pandas-dev:master Nov 23, 2018
@jreback
Copy link
Contributor

jreback commented Nov 23, 2018

thanks @simonjayhawkins

@jreback
Copy link
Contributor

jreback commented Nov 23, 2018

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.

@simonjayhawkins simonjayhawkins deleted the multiindex-tests branch November 23, 2018 11:18
@simonjayhawkins
Copy link
Member Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TST: split up pandas/tests/test_multilevel.py
3 participants