-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF/TST: Add more pytest idiom to tests/resample #24230
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
REF/TST: Add more pytest idiom to tests/resample #24230
Conversation
Hello @simonjayhawkins! Thanks for submitting the PR.
|
raise | ||
expected.index = inds | ||
assert_series_equal(result, expected) | ||
except BaseException as exc: |
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 remove this catching of BaseException (e.g. the try/accept), with parameterized methods it is uncessary
@@ -140,7 +138,7 @@ def test_resample_how(self): | |||
grouplist[1:6] = 1 | |||
grouplist[6:11] = 2 | |||
grouplist[11:] = 3 | |||
args = downsample_methods | |||
arg = downsample_method |
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.
it might be worthile to move ohlc to a separate test
@@ -15,8 +15,7 @@ | |||
from pandas import DataFrame, Series, Timestamp | |||
from pandas.core.indexes.datetimes import date_range | |||
from pandas.core.indexes.period import Period, PeriodIndex, period_range | |||
from pandas.tests.resample.test_base import ( | |||
Base, resample_methods, simple_period_range_series) | |||
from pandas.tests.resample.test_base import Base |
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.
is this needed?
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.
all the tests in Base
are run for each class that inherits from Base
. so the next pass will be to parametrize the Base
class over the parameters in the classes that inherit from Base
in order to be able to remove this dependency. I'll do this in a separate pass since the tests in Base
rely on a method override so it is not trivial.
Codecov Report
@@ Coverage Diff @@
## master #24230 +/- ##
=======================================
Coverage 92.21% 92.21%
=======================================
Files 162 162
Lines 51763 51763
=======================================
Hits 47733 47733
Misses 4030 4030
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #24230 +/- ##
=======================================
Coverage 92.22% 92.22%
=======================================
Files 162 162
Lines 51785 51785
=======================================
Hits 47759 47759
Misses 4026 4026
Continue to review full report at Codecov.
|
lgtm. can you merge master and ping on green as just merged a resample bug fix. |
@jreback green! |
thanks @simonjayhawkins |
xref #17806
follow-on from #24013
This pass replaces imports from tests/resample/test_base.py with fixtures and only parametrizes tests where necessary to accomplish this.