Skip to content

Commit 6e9a209

Browse files
test: deduplicate datetime index tests (#1460) (#1461)
test: deduplicate datetime index tests Remove duplicate test code for DatetimeIndex relational operations. The tests with dt_idx were duplicating the same tests already performed with idx, since both are DatetimeIndex objects. Fixes #1460
1 parent 45ac3c1 commit 6e9a209

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

tests/indexes/test_datetime_index.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,6 @@ def test_index_relops() -> None:
3535
check(assert_type(data[idx >= x], pd.DatetimeIndex), pd.DatetimeIndex)
3636
check(assert_type(data[idx > x], pd.DatetimeIndex), pd.DatetimeIndex)
3737

38-
# TODO: https://github.com/pandas-dev/pandas-stubs/pull/1438#discussion_r2451864012
39-
# Can this be de-duplicated?
40-
dt_idx = pd.DatetimeIndex(data, name="date")
41-
check(assert_type(data[x <= dt_idx], pd.DatetimeIndex), pd.DatetimeIndex)
42-
check(assert_type(data[x < dt_idx], pd.DatetimeIndex), pd.DatetimeIndex)
43-
check(assert_type(data[x >= dt_idx], pd.DatetimeIndex), pd.DatetimeIndex)
44-
check(assert_type(data[x > dt_idx], pd.DatetimeIndex), pd.DatetimeIndex)
45-
check(assert_type(data[dt_idx <= x], pd.DatetimeIndex), pd.DatetimeIndex)
46-
check(assert_type(data[dt_idx < x], pd.DatetimeIndex), pd.DatetimeIndex)
47-
check(assert_type(data[dt_idx >= x], pd.DatetimeIndex), pd.DatetimeIndex)
48-
check(assert_type(data[dt_idx > x], pd.DatetimeIndex), pd.DatetimeIndex)
49-
5038
ind = pd.Index([1, 2, 3])
5139
check(assert_type(ind <= 2, np_1darray[np.bool]), np_1darray[np.bool])
5240
check(assert_type(ind < 2, np_1darray[np.bool]), np_1darray[np.bool])

0 commit comments

Comments
 (0)