-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Parametrize tests in tools/test_numeric.py #21717
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: Parametrize tests in tools/test_numeric.py #21717
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21717 +/- ##
=======================================
Coverage 91.92% 91.92%
=======================================
Files 158 158
Lines 49703 49703
=======================================
Hits 45689 45689
Misses 4014 4014
Continue to review full report at Codecov.
|
pandas/tests/tools/test_numeric.py
Outdated
idx = pd.date_range('20130101', periods=3, tz=tz, name='xxx') | ||
res = pd.to_numeric(idx) | ||
tm.assert_index_equal(res, pd.Index(idx.asi8, name='xxx')) | ||
@pytest.mark.parametrize("tz", [None, "US/Eastern", "Asia/Tokyo"]) |
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.
Should the common tz_naive_fixture
be used here? It has a few extra timezones, but I'm not sure if it tests anything extra/if there's a benefit to including the extra ones:
Lines 221 to 230 in 7cd2679
TIMEZONES = [None, 'UTC', 'US/Eastern', 'Asia/Tokyo', 'dateutil/US/Pacific'] | |
@td.parametrize_fixture_doc(str(TIMEZONES)) | |
@pytest.fixture(params=TIMEZONES) | |
def tz_naive_fixture(request): | |
""" | |
Fixture for trying timezones including default (None): {0} | |
""" | |
return request.param |
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.
yes ideally we re-use our fixtures as much as possible
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.
That makes sense to me. Done.
pandas/tests/tools/test_numeric.py
Outdated
idx = pd.date_range('20130101', periods=3, tz=tz, name='xxx') | ||
res = pd.to_numeric(idx) | ||
tm.assert_index_equal(res, pd.Index(idx.asi8, name='xxx')) | ||
@pytest.mark.parametrize("tz", [None, "US/Eastern", "Asia/Tokyo"]) |
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.
yes ideally we re-use our fixtures as much as possible
6669439
to
3042714
Compare
@jreback @jschendel : Comments addressed, and all is still green. PTAL. |
thanks @gfyoung very nice! |
Title is self-explanatory.