Skip to content

TST: move to indices fixture instead of create_index #32916

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 6 commits into from
Mar 24, 2020

Conversation

jbrockmendel
Copy link
Member

No description provided.

def test_tolist_matches_list(indices):
assert indices.tolist() == list(indices)
class TestRendering:
def test_str(self, indices):
Copy link
Member

Choose a reason for hiding this comment

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

hmm, may need to rethink this test now testing over all indexes since "tuples": MultiIndex.from_tuples(zip(["foo", "bar", "baz"], [1, 2, 3])), so "foo" is already in str(indices)


@pytest.mark.parametrize("label", [1.0, "foobar", "xyzzy", np.nan])
def test_isin_level_kwarg_bad_label_raises(self, label, indices):
index = indices
if isinstance(index, MultiIndex):
index = index.rename(["foo", "bar"])
index = index.rename(["foo", "bar"] + index.names[2:])
Copy link
Member

Choose a reason for hiding this comment

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

hmm, I think the intention of the explicitly renaming was to ensure that the labels being tested were not already in the index.

@simonjayhawkins simonjayhawkins added the Testing pandas testing functions or related to the test suite label Mar 23, 2020
@simonjayhawkins simonjayhawkins added this to the 1.1 milestone Mar 23, 2020
Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

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

Thanks @jbrockmendel generally lgtm.

@jreback jreback merged commit cd52920 into pandas-dev:master Mar 24, 2020
@jreback
Copy link
Contributor

jreback commented Mar 24, 2020

thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the tst-any-index-4 branch April 5, 2020 17:33
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.

3 participants