-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Parametrize tests for Series[timedelta64] integer arithmetic #19166
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
assert_series_equal(s + ts, expected) | ||
class TestTimedeltaSeriesArithmeticWithIntegers(object): | ||
@classmethod | ||
def setup_class(cls): |
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.
don't setup the class, rather use a fixture
assert_series_equal(ts + s, expected) | ||
assert_series_equal(s + ts, expected) | ||
class TestTimedeltaSeriesArithmeticWithIntegers(object): | ||
@classmethod |
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.
I know this seems obvious but add a comment on what this class is testing
pytest.raises(TypeError, sop, s2.values) | ||
|
||
class TestTimedeltaSeriesArithmetic(object): | ||
def test_timedelta_series_ops(self): |
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.
doc-string
Codecov Report
@@ Coverage Diff @@
## master #19166 +/- ##
==========================================
+ Coverage 91.52% 91.52% +<.01%
==========================================
Files 148 147 -1
Lines 48778 48773 -5
==========================================
- Hits 44642 44638 -4
+ Misses 4136 4135 -1
Continue to review full report at Codecov.
|
# Addition and Subtraction | ||
|
||
def test_td64series_add_int_series_invalid(self): | ||
tdser = Series(['59 Days', '59 Days', 'NaT'], dtype='timedelta64[ns]') |
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.
since you are repeating this everywhere, use a fixture for tdser
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.
Any wiggle room on this request? I really prefer to be able to tell what is going on in a test just by looking at it, to be able to just copy/paste the text of a test when something goes wrong.
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.
no wiggle room. This just adds so much boilerplate. that is the entire purpose of fixtures, to avoid copy-paste boilerplate.
thanks! |
Breaks up a few big tests, parametrizes, covers cases much more thoroughly including identifying a few new xfails.
git diff upstream/master -u -- "*.py" | flake8 --diff