Skip to content

REF: collect+parametrize reorder_levels tests #32373

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 11 commits into from
Mar 2, 2020

Conversation

jbrockmendel
Copy link
Member

No description provided.


# no change, position
result = obj.reorder_levels([0, 1, 2])
tm.assert_equal(obj, result)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is going to happen a lot with these changes, should maybe consider a solution that can maintain the correct assertion helper.

either in the parameterisation as "klass, helper" or create a fixture something like

@fixture()
def assert_klass_equal(klass):
    if isinstance(klass, DataFrame):
      return tm.assert_frame_equal
    elif isinstance(klass, Series):
      return tm.assert_series_equal
   else:
      assert False 

(code not tested!)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might make sense to add as a kwarg to tm.assert_equal

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that sounds good as well. could be follow-up

@simonjayhawkins simonjayhawkins added the Testing pandas testing functions or related to the test suite label Feb 29, 2020
@simonjayhawkins simonjayhawkins added this to the 1.1 milestone Feb 29, 2020
@simonjayhawkins simonjayhawkins merged commit 7e6b583 into pandas-dev:master Mar 2, 2020
@simonjayhawkins
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the tst-alter_axes branch March 2, 2020 15:30
roberthdevries pushed a commit to roberthdevries/pandas that referenced this pull request Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants