forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TST: Remove inheritance from pandas/tests/indexes (pandas-dev#53544)
* Refactor test/indexes * Address failures
- Loading branch information
Showing
10 changed files
with
253 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,10 @@ | ||
""" generic tests from the Datetimelike class """ | ||
import pytest | ||
from pandas import date_range | ||
|
||
from pandas import ( | ||
DatetimeIndex, | ||
date_range, | ||
) | ||
import pandas._testing as tm | ||
from pandas.tests.indexes.datetimelike import DatetimeLike | ||
|
||
|
||
class TestDatetimeIndex(DatetimeLike): | ||
_index_cls = DatetimeIndex | ||
|
||
@pytest.fixture | ||
def simple_index(self) -> DatetimeIndex: | ||
return date_range("20130101", periods=5) | ||
|
||
@pytest.fixture( | ||
params=[tm.makeDateIndex(10), date_range("20130110", periods=10, freq="-1D")], | ||
ids=["index_inc", "index_dec"], | ||
) | ||
def index(self, request): | ||
return request.param | ||
|
||
def test_format(self, simple_index): | ||
class TestDatetimeIndex: | ||
def test_format(self): | ||
# GH35439 | ||
idx = simple_index | ||
idx = date_range("20130101", periods=5) | ||
expected = [f"{x:%Y-%m-%d}" for x in idx] | ||
assert idx.format() == expected | ||
|
||
def test_shift(self): | ||
pass # handled in test_ops | ||
|
||
def test_intersection(self): | ||
pass # handled in test_setops | ||
|
||
def test_union(self): | ||
pass # handled in test_setops |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.