Skip to content

Commit 31bb04a

Browse files
authored
TST: Test searchsorted for monotonic decreasing index (#58692)
1 parent b195361 commit 31bb04a

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

pandas/tests/indexes/test_common.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,7 @@ def test_searchsorted_monotonic(self, index_flat, request):
270270
# all values are the same, expected_right should be length
271271
expected_right = len(index)
272272

273-
# test _searchsorted_monotonic in all cases
274-
# test searchsorted only for increasing
275-
if index.is_monotonic_increasing:
273+
if index.is_monotonic_increasing or index.is_monotonic_decreasing:
276274
ssm_left = index._searchsorted_monotonic(value, side="left")
277275
assert expected_left == ssm_left
278276

@@ -284,13 +282,6 @@ def test_searchsorted_monotonic(self, index_flat, request):
284282

285283
ss_right = index.searchsorted(value, side="right")
286284
assert expected_right == ss_right
287-
288-
elif index.is_monotonic_decreasing:
289-
ssm_left = index._searchsorted_monotonic(value, side="left")
290-
assert expected_left == ssm_left
291-
292-
ssm_right = index._searchsorted_monotonic(value, side="right")
293-
assert expected_right == ssm_right
294285
else:
295286
# non-monotonic should raise.
296287
msg = "index must be monotonic increasing or decreasing"

0 commit comments

Comments
 (0)