-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Separate tests specific to tslibs modules #18036
Conversation
pandas/tests/scalar/test_parsing.py
Outdated
|
||
result = parsing.try_parse_dates(arr, dayfirst=True) | ||
expected = [parse(d, dayfirst=True) for d in arr] | ||
assert np.array_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.
I know this is a refactoring, but let's take this opportunity to remove np.array_equal
from our testing. Let's rewrite to use tm.assert_numpy_array_equal
instead.
Codecov Report
@@ Coverage Diff @@
## master #18036 +/- ##
==========================================
+ Coverage 91.24% 91.25% +<.01%
==========================================
Files 163 163
Lines 50100 50100
==========================================
+ Hits 45714 45717 +3
+ Misses 4386 4383 -3
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18036 +/- ##
==========================================
+ Coverage 91.24% 91.25% +<.01%
==========================================
Files 163 163
Lines 50100 50100
==========================================
+ Hits 45714 45717 +3
+ Misses 4386 4383 -3
Continue to review full report at Codecov.
|
pandas/tests/scalar/test_parsing.py
Outdated
@@ -136,4 +136,4 @@ def test_try_parse_dates(self): | |||
|
|||
result = parsing.try_parse_dates(arr, dayfirst=True) | |||
expected = [parse(d, dayfirst=True) for d in arr] | |||
assert np.array_equal(result, expected) | |||
assert tm.assert_numpy_array_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.
Remove the assert
keyword. tm.assert_...
takes care of that for you. As written, this will cause an AssertionError
since the function call returns None
.
you took out 15 tests and added back 10, what happened? |
There was a Travis stall in test_clipboard (I think), needed to re-start CI, so needed to make a new commit. As it happens, |
thanks! |
as far as fully exercising numeric ops. all for it. Most of these are tested directly thru a single inheritance mechnaism revolving around subclassing the mixins in test_base.py You can certainly isolate these and add, but this is quite tricky, and we have to assure that we are not losing coverage. |
Going through the tests in tests/scalars, tests/indexes/datetimes, tests/indexes/timedeltas, tests/indexes/period, there is a lot of duplication and a lot of thematically inappropriate placement. This is a natural result of tests being added over the years.
One result of this, though, is that its easy to miss certain corner cases (#17991, #7996).
There are two things I'd like to do here. First is gather tests specific to
tslibs
modules so they can be self-contained. This PR starts that fortslibs.parsing
.Second is to go through tests.indexes centralize arithmetic tests, deduplicate where needed (#18026). This is a big task without an immediate payoff, so I want to get the go-ahead before jumping in.
git diff upstream/master -u -- "*.py" | flake8 --diff