Skip to content
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

Merged
merged 2 commits into from
Sep 8, 2018

Conversation

jbrockmendel
Copy link
Member

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.

@codecov
Copy link

codecov bot commented Sep 1, 2018

Codecov Report

Merging #22559 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #22559   +/-   ##
=======================================
  Coverage   92.04%   92.04%           
=======================================
  Files         169      169           
  Lines       50787    50787           
=======================================
  Hits        46745    46745           
  Misses       4042     4042
Flag Coverage Δ
#multiple 90.45% <ø> (ø) ⬆️
#single 42.29% <ø> (ø) ⬆️

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 98fb53c...30472ee. Read the comment docs.

@gfyoung gfyoung added Refactor Internal refactoring of code Testing pandas testing functions or related to the test suite labels Sep 1, 2018
Copy link
Member

@gfyoung gfyoung left a comment

Choose a reason for hiding this comment

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

@jreback jreback added this to the 0.24.0 milestone Sep 4, 2018
df > ts
with pytest.raises(TypeError):
df < ts
with pytest.raises(TypeError):
Copy link
Contributor

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?

Copy link
Member Author

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

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 for tz as well (use the fixture)

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; 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)

Copy link
Contributor

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)

Copy link
Member Author

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
Copy link
Contributor

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)

Copy link
Member Author

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

@jbrockmendel
Copy link
Member Author

Blocker for some parameterization/deduplication

@jreback jreback merged commit 9b2e6db into pandas-dev:master Sep 8, 2018
@jreback
Copy link
Contributor

jreback commented Sep 8, 2018

thanks!

@jbrockmendel jbrockmendel deleted the arith_tests9 branch September 8, 2018 03:24
aeltanawy pushed a commit to aeltanawy/pandas that referenced this pull request Sep 20, 2018
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
Refactor Internal refactoring of code 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