-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
TST: Remove dupe TimdeltaIndex tests from indexes/timedeltas/test_astype.py #19509
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
|
||
def test_shift(self): | ||
# test shift for TimedeltaIndex | ||
# err8083 |
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.
note that this same test is also in test_arithmetic.py
, and is overriden in test_timedeltas
:
pandas/pandas/tests/indexes/timedeltas/test_timedelta.py
Lines 35 to 36 in 69cd5fb
def test_shift(self): | |
pass # this is handled in test_arithmetic.py |
pandas/pandas/tests/indexes/timedeltas/test_arithmetic.py
Lines 170 to 187 in 69cd5fb
def test_tdi_shift_int(self): | |
# GH#8083 | |
trange = pd.to_timedelta(range(5), unit='d') + pd.offsets.Hour(1) | |
result = trange.shift(1) | |
expected = TimedeltaIndex(['1 days 01:00:00', '2 days 01:00:00', | |
'3 days 01:00:00', | |
'4 days 01:00:00', '5 days 01:00:00'], | |
freq='D') | |
tm.assert_index_equal(result, expected) | |
def test_tdi_shift_nonstandard_freq(self): | |
# GH#8083 | |
trange = pd.to_timedelta(range(5), unit='d') + pd.offsets.Hour(1) | |
result = trange.shift(3, freq='2D 1s') | |
expected = TimedeltaIndex(['6 days 01:00:03', '7 days 01:00:03', | |
'8 days 01:00:03', '9 days 01:00:03', | |
'10 days 01:00:03'], freq='D') | |
tm.assert_index_equal(result, expected) |
Codecov Report
@@ Coverage Diff @@
## master #19509 +/- ##
=======================================
Coverage 91.69% 91.69%
=======================================
Files 148 148
Lines 48561 48561
=======================================
Hits 44530 44530
Misses 4031 4031
Continue to review full report at Codecov.
|
+1 FWIW there are some other
|
|
||
class TestTimedeltaIndex(DatetimeLike): | ||
_holder = TimedeltaIndex | ||
class TestTimedeltaIndex(object): | ||
_multiprocess_can_split_ = True |
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 any of these _multi precess_can_split
, they are really old
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.
actually let's do that separately.
thanks! |
git diff upstream/master -u -- "*.py" | flake8 --diff
Both classes in
test_astype.py
andtest_timedelta.py
inherit fromDatetimeLike
, which in turn inherits fromBase
, leading to 200+ dupe tests being run.Modified
test_astype.py
to inherit fromobject
instead, removed some unnecessary boilerplate, and removed some additional tests that were specified to override base class tests.