Skip to content

Commit 97d281e

Browse files
committed
parametrize test
1 parent 6f27b9a commit 97d281e

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

pandas/tests/indexes/test_range.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -995,21 +995,21 @@ def test_append(self):
995995
result2 = indices[0].append(indices[1])
996996
tm.assert_index_equal(result2, expected, exact=True)
997997

998-
def test_max_min(self):
999-
params = [(0, 400, 3), (500, 0, -6), (-10**6, 10**6, 4),
1000-
(10**6, -10**6, -4), (0, 10, 20)]
1001-
for start, stop, step in params:
1002-
idx = RangeIndex(start, stop, step)
1003-
1004-
expected = idx._int64index.max()
1005-
result = idx.max()
1006-
assert result == expected
998+
@pytest.mark.parametrize('start,stop,step',
999+
[(0, 400, 3), (500, 0, -6), (-10**6, 10**6, 4),
1000+
(10**6, -10**6, -4), (0, 10, 20)])
1001+
def test_max_min(self, start, stop, step):
1002+
# GH17607
1003+
idx = RangeIndex(start, stop, step)
1004+
expected = idx._int64index.max()
1005+
result = idx.max()
1006+
assert result == expected
10071007

1008-
expected = idx._int64index.min()
1009-
result = idx.min()
1010-
assert result == expected
1008+
expected = idx._int64index.min()
1009+
result = idx.min()
1010+
assert result == expected
10111011

10121012
# empty
1013-
idx = RangeIndex(0, 1, -1)
1013+
idx = RangeIndex(start, stop, -step)
10141014
assert isna(idx.max())
10151015
assert isna(idx.min())

0 commit comments

Comments
 (0)