Skip to content

TST: Split tests/indexes/interval/test_interval.py into separate files #19009

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
Dec 30, 2017

Conversation

jschendel
Copy link
Member

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

Since we now have an interval subdirectory, seems logical to split test_interval.py into separate files, similar to what has been done for DatetimeIndex, PeriodIndex, and TimedeltaIndex.

Just made very basic changes here, moving things at the class level, and didn't break apart any classes. All of the tests should functionally be the same.

Summary:

  • Moved TestIntervalRange class from test_interval.py to test_interval_range.py
  • Moved TestIntervalTree class from test_interval.py to test_interval_tree.py
    • Changed a few for loops to @pytest.mark.parametrize
    • Converted a lambda to an actual function (my linter was complaining about PEP8 E731)
  • No changes to test_interval_new.py
    • Should still only cover tests in test_interval.py

Down the road we could probably split test_interval.py into smaller components, much like what was done for DatetimeIndex, PeriodIndex, and TimedeltaIndex. Might want to wait until the _new.py files are fully addressed though. Didn't look like there were any high level changes like this that could be made in tests/indexing/interval/.

@jreback jreback added Interval Interval data type Testing pandas testing functions or related to the test suite labels Dec 30, 2017
return request.param


class TestIntervalRange(object):
Copy link
Contributor

Choose a reason for hiding this comment

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

as an aside, we don't generally need classes, unless you have multiple logical groupings within a single file (but then usually we just want separate files). no harm though.

@jreback jreback added this to the 0.23.0 milestone Dec 30, 2017
@jreback
Copy link
Contributor

jreback commented Dec 30, 2017

lgtm. ping on travis green.

@jreback jreback merged commit 0e3c797 into pandas-dev:master Dec 30, 2017
@jreback
Copy link
Contributor

jreback commented Dec 30, 2017

thanks @jschendel

@jschendel jschendel deleted the split-intervalindex-test branch December 31, 2017 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

2 participants