Skip to content

Commit b312fe4

Browse files
committed
revert interval
1 parent d8e7ba4 commit b312fe4

File tree

1 file changed

+7
-25
lines changed

1 file changed

+7
-25
lines changed

pandas/tests/arrays/interval/test_interval.py

+7-25
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# -*- coding: utf-8 -*-
22
import numpy as np
3+
import pytest
34

4-
from pandas import Index, date_range, option_context, timedelta_range
5+
from pandas import Index, IntervalIndex, date_range, timedelta_range
56
from pandas.core.arrays import IntervalArray
67
import pandas.util.testing as tm
7-
import pytest
88

99

1010
@pytest.fixture(params=[
@@ -65,26 +65,8 @@ def test_set_na(self, left_right_dtypes):
6565
tm.assert_extension_array_equal(result, expected)
6666

6767

68-
def test_repr_small():
69-
arr = IntervalArray.from_breaks([1, 2, 3])
70-
result = repr(arr)
71-
expected = (
72-
'<IntervalArray>\n'
73-
'[(1, 2], (2, 3]]\n'
74-
'Length: 2, dtype: interval[int64]'
75-
)
76-
assert result == expected
77-
78-
79-
def test_repr_large():
80-
arr = IntervalArray.from_breaks([1, 2, 3, 4, 5, 6])
81-
with option_context('display.max_seq_items', 2):
82-
result = repr(arr)
83-
expected = (
84-
'<IntervalArray>\n'
85-
'[(1, 2],\n'
86-
' ...\n'
87-
' (5, 6]] \n'
88-
'Length: 5, dtype: interval[int64]'
89-
)
90-
assert result == expected
68+
def test_repr_matches():
69+
idx = IntervalIndex.from_breaks([1, 2, 3])
70+
a = repr(idx)
71+
b = repr(idx.values)
72+
assert a.replace("Index", "Array") == b

0 commit comments

Comments
 (0)