Skip to content

Update test_period_range.py #34175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
May 15, 2020
8 changes: 8 additions & 0 deletions pandas/tests/indexes/period/test_period_range.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import numpy as np
import pytest

from pandas import NaT, Period, PeriodIndex, date_range, period_range
Expand Down Expand Up @@ -51,6 +52,13 @@ def test_construction_from_period(self):
result = period_range(start=start, end=end, freq="Q", name="foo")
tm.assert_index_equal(result, expected)

# test for issue # 21793
start, end = Period("2017Q1", freq="Q"), Period("2018Q1", freq="Q")
idx = period_range(start=start, end=end, freq="Q", name="foo")
result = idx == idx.values
expected = np.array([True, True, True, True, True])
tm.assert_numpy_array_equal(result, expected)

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

Expand Down