Skip to content

TST: Condense tests in test_interval_new.py and add new test based on TODO #23275

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 1 commit into from
Oct 23, 2018

Conversation

jschendel
Copy link
Member

  • passes git diff upstream/master -u -- "*.py" | flake8 --diff

Combined a some pairs of similar tests into single tests, e.g. test_get_indexer_with_interval_multiple_queries and test_get_indexer_with_interval_single_queries are essentially testing the same functionality but with different input to get_indexer, so just needed a couple of superficial changes to combine into a single test.

I also added one test based on a TODO, test_get_indexer_errors, which verifies that get_indexer raises if the IntervalIndex is overlapping. Note that this is consistent with get_indexer raising for other indexes if the index is non-unique; for intervals uniqueness is not enough to ensure unique query results, as a scalar query against an overlapping IntervalIndex can return non-unique indices.

I've got all these tests to pass on my WIP branch implementing the new behavior, with the exception of the slice_locs tests, so will hopefully have a PR for that soon.

@jschendel jschendel added Testing pandas testing functions or related to the test suite Interval Interval data type Clean labels Oct 22, 2018
@jschendel jschendel added this to the 0.24.0 milestone Oct 22, 2018
@@ -12,13 +12,6 @@

class TestIntervalIndex(object):

def _compare_tuple_of_numpy_array(self, result, expected):
Copy link
Member Author

Choose a reason for hiding this comment

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

this is never used

@pep8speaks
Copy link

Hello @jschendel! Thanks for submitting the PR.

@jreback jreback merged commit a2b4b4a into pandas-dev:master Oct 23, 2018
@jreback
Copy link
Contributor

jreback commented Oct 23, 2018

thanks!

jorisvandenbossche added a commit that referenced this pull request Oct 23, 2018
JustinZhengBC pushed a commit to JustinZhengBC/pandas that referenced this pull request Oct 23, 2018
@jschendel jschendel deleted the ii-new-tests-clean branch October 25, 2018 03:42
tm9k1 pushed a commit to tm9k1/pandas that referenced this pull request Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Interval Interval data type 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