-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
TST: Continue collecting arithmetic tests #22559
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22559 +/- ##
=======================================
Coverage 92.04% 92.04%
=======================================
Files 169 169
Lines 50787 50787
=======================================
Hits 46745 46745
Misses 4042 4042
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.
cc @jreback
df > ts | ||
with pytest.raises(TypeError): | ||
df < ts | ||
with pytest.raises(TypeError): |
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.
shouldn't these be in test_datetime64?
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, this is specifically testing that the numeric-dtypes are correctly handling the presence of datetime64-dtype, not vice-versa.
ts < df | ||
with pytest.raises(TypeError): | ||
ts > df | ||
|
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 for tz as well (use the fixture)
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; follow-up. This PR is pretty specifically only-moving.
@@ -180,3 +180,36 @@ def test_series_with_dtype_radd_timedelta(self, dtype): | |||
|
|||
result = ser + pd.Timedelta('3 days') | |||
tm.assert_series_equal(result, expected) | |||
|
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.
would move these to test_datetime64 (maybe rename that to test_datetime)
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.
These are mixed-type; it's pretty specifically the object-dtyped Index/Series/Column that these tests are addressing.
b = pd.Series(np.random.randn(5)) | ||
b.name = pd.Timestamp('2000-01-01') | ||
tm.assert_series_equal(a / b, 1 / (b / a)) | ||
|
||
|
||
# ------------------------------------------------------------------ | ||
# Numeric dtypes Arithmetic with Timedelta Scalar |
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.
are there timedelta tests that should be moved (ok for followup, just indicate)
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.
Those should all be in test_arithmetic, which this PR moves to arithmetic.test_timedelta64
Blocker for some parameterization/deduplication |
thanks! |
This is split off of #22350, which may have been too ambitious.
tests/test_arithmetic.py is moved to tests/arithmetic/test_timedelta64.py. Aside from being moved it is untouched.