Skip to content

Split+Parametrize Timedelta tests #19736

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 9 commits into from
Feb 20, 2018
Merged

Conversation

jbrockmendel
Copy link
Member

Started splitting non-contentious parts off of #19365. This even-easier bit got split off of that. Just organizing+splitting+parametrizing tests.

@codecov
Copy link

codecov bot commented Feb 17, 2018

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #19736      +/-   ##
==========================================
+ Coverage    91.6%   91.61%   +<.01%     
==========================================
  Files         150      150              
  Lines       48864    48887      +23     
==========================================
+ Hits        44763    44786      +23     
  Misses       4101     4101
Flag Coverage Δ
#multiple 89.98% <ø> (ø) ⬆️
#single 41.8% <ø> (+0.02%) ⬆️
Impacted Files Coverage Δ
pandas/core/panel.py 97.3% <0%> (ø) ⬆️
pandas/core/ops.py 96.74% <0%> (+0.12%) ⬆️

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 718d067...a852a4b. Read the comment docs.

@@ -953,6 +770,162 @@ def test_isoformat(self):
expected = 'P0DT0H1M0S'
assert result == expected


class TestTimedeltaConstructor(object):
Copy link
Contributor

Choose a reason for hiding this comment

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

rather than just moving things around, can you split into sub-modules
scalar/timedelta/test_construction (and so on), ok to just move these (and just move the main file to scalar/timedelta/test_timedelta for now as well

@jreback jreback added Testing pandas testing functions or related to the test suite Timedelta Timedelta data type labels Feb 18, 2018
@jbrockmendel
Copy link
Member Author

For now I'll update this PR to make timedeltas/test_construction.py, will move the others after #19744 (a not just-refactoring PR) goes through.

@jbrockmendel
Copy link
Member Author

This didn't get an explicit "ping on green", but pretty close. ping.

from pandas import Timedelta


class TestTimedeltaConstructor(object):
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 de-class these

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.

@@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
from pandas import Timedelta
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 de-class these. I think we are calling this test_formats.py elsewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we are calling this test_formats.py elsewhere?

In scalar.timestamps we're calling it test_rendering. In tests.indexes we recently moved a bunch of thematically related tests to pre-existing test_formats.py files (that each only had one test in them, so seemed lonely).

I have a mild preference for "test_rendering" since it is pretty specifically about __repr__ variants, whereas "test_formats" could reasonably refer to e.g. to_csv.

Copy link
Contributor

Choose a reason for hiding this comment

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

just use test_formats for now.

@jreback jreback added this to the 0.23.0 milestone Feb 20, 2018
@jreback
Copy link
Contributor

jreback commented Feb 20, 2018

lgtm ping on green

@jreback
Copy link
Contributor

jreback commented Feb 20, 2018

thanks!

@jreback jreback merged commit 1cf0c3a into pandas-dev:master Feb 20, 2018
harisbal pushed a commit to harisbal/pandas that referenced this pull request Feb 28, 2018
@jbrockmendel jbrockmendel deleted the tdfixes3 branch June 22, 2018 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants