-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #19736 +/- ##
==========================================
+ Coverage 91.6% 91.61% +<.01%
==========================================
Files 150 150
Lines 48864 48887 +23
==========================================
+ Hits 44763 44786 +23
Misses 4101 4101
Continue to review full report at Codecov.
|
@@ -953,6 +770,162 @@ def test_isoformat(self): | |||
expected = 'P0DT0H1M0S' | |||
assert result == expected | |||
|
|||
|
|||
class TestTimedeltaConstructor(object): |
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.
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
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. |
This didn't get an explicit "ping on green", but pretty close. ping. |
from pandas import Timedelta | ||
|
||
|
||
class TestTimedeltaConstructor(object): |
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 de-class these
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.
@@ -0,0 +1,48 @@ | |||
# -*- coding: utf-8 -*- | |||
from pandas import Timedelta |
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 de-class these. I think we are calling this test_formats.py elsewhere?
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 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
.
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.
just use test_formats for now.
lgtm ping on green |
thanks! |
Started splitting non-contentious parts off of #19365. This even-easier bit got split off of that. Just organizing+splitting+parametrizing tests.