-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21405 +/- ##
==========================================
+ Coverage 91.89% 91.9% +<.01%
==========================================
Files 153 153
Lines 49600 49600
==========================================
+ Hits 45580 45583 +3
+ Misses 4020 4017 -3
Continue to review full report at Codecov.
|
There was a problem hiding this 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 |
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
thanks @jbrockmendel |
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.