Skip to content

Commit ea90f26

Browse files
natmokvalim-vinicius
authored and
im-vinicius
committed
TST: add test with freq=2M for period_array from datetime64 (pandas-dev#53890)
1 parent 9dcc075 commit ea90f26

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/tests/arrays/period/test_constructors.py

+9
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ def test_from_datetime64_freq_changes():
5656
tm.assert_period_array_equal(result, expected)
5757

5858

59+
def test_from_datetime64_freq_2M():
60+
arr = np.array(
61+
["2020-01-01T00:00:00", "2020-01-02T00:00:00"], dtype="datetime64[ns]"
62+
)
63+
result = PeriodArray._from_datetime64(arr, "2M")
64+
expected = period_array(["2020-01", "2020-01"], freq="2M")
65+
tm.assert_period_array_equal(result, expected)
66+
67+
5968
@pytest.mark.parametrize(
6069
"data, freq, msg",
6170
[

0 commit comments

Comments
 (0)