Skip to content

parametrize tests, unify repeated tests #21405

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 5 commits into from
Jun 13, 2018
Merged

Conversation

jbrockmendel
Copy link
Member

There's more to do, but the diff is already pretty big as it is.

There are a handful of test methods that are defined in 5-6 test classes. By moving those to the base class we a) get rid of duplicate code and b) run the tests for all (well, most) DateOffset subclasses.

@gfyoung gfyoung added Testing pandas testing functions or related to the test suite Clean labels Jun 10, 2018
@codecov
Copy link

codecov bot commented Jun 10, 2018

Codecov Report

Merging #21405 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #21405      +/-   ##
==========================================
+ Coverage   91.89%    91.9%   +<.01%     
==========================================
  Files         153      153              
  Lines       49600    49600              
==========================================
+ Hits        45580    45583       +3     
+ Misses       4020     4017       -3
Flag Coverage Δ
#multiple 90.3% <ø> (ø) ⬆️
#single 41.89% <ø> (+0.03%) ⬆️
Impacted Files Coverage Δ
pandas/tseries/offsets.py 97.24% <0%> (+0.24%) ⬆️

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 ab668b0...d378120. Read the comment docs.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

looks good. some comment requests. ping on green.

@@ -148,6 +148,50 @@ def test_apply_out_of_range(self, tz):
# so ignore
pass

def test_offsets_compare_equal(self):
# root cause of GH#456
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a more informative comment


def test_rsub(self):
if self._offset is None or not hasattr(self, 'd'):
# TODO: define `d` for classes where it is missing?
Copy link
Contributor

Choose a reason for hiding this comment

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

can you expand this coment (and similar fo radd)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. Turns out its easy just to define d for all but one of the subclasses that is currently missing it.

@@ -1424,33 +1429,18 @@ def testEQ(self):
assert (CustomBusinessHour(holidays=['2014-06-27']) !=
CustomBusinessHour(holidays=['2014-06-28']))

def test_sub(self):
# override Base implementation
Copy link
Contributor

Choose a reason for hiding this comment

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

can you provide a better comment here. why is skipped?

@jreback jreback added this to the 0.24.0 milestone Jun 12, 2018
@jreback jreback added the Frequency DateOffsets label Jun 12, 2018
@jreback jreback merged commit c8f27cc into pandas-dev:master Jun 13, 2018
@jreback
Copy link
Contributor

jreback commented Jun 13, 2018

thanks @jbrockmendel

david-liu-brattle-1 pushed a commit to david-liu-brattle-1/pandas that referenced this pull request Jun 18, 2018
@jbrockmendel jbrockmendel deleted the offtest branch June 22, 2018 03:27
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Frequency DateOffsets 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