Skip to content

Commit abce52f

Browse files
author
jnecus
committed
Update test_period_range.py
1 parent 4df4bc7 commit abce52f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pandas/tests/indexes/period/test_period_range.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from pandas import NaT, Period, PeriodIndex, date_range, period_range
44
import pandas._testing as tm
5-
5+
import numpy as np
66

77
class TestPeriodRange:
88
@pytest.mark.parametrize("freq", ["D", "W", "M", "Q", "A"])
@@ -53,8 +53,13 @@ def test_construction_from_period(self):
5353

5454
# test for issue #21793
5555
idx = period_range(start=start, end=end, freq="Q", name="foo")
56-
result = idx == idx.values
57-
assert result.all()
56+
result = idx.values
57+
expected = np.array([Period('2017Q1', 'Q-DEC'),
58+
Period('2017Q2', 'Q-DEC'),
59+
Period('2017Q3', 'Q-DEC'),
60+
Period('2017Q4', 'Q-DEC'),
61+
Period('2018Q1', 'Q-DEC')])
62+
tm.assert_numpy_array_equal(result, expected)
5863

5964
# empty
6065
expected = PeriodIndex([], freq="W", name="foo")

0 commit comments

Comments
 (0)