Skip to content

Commit

Permalink
TST: add test with freq=2M for period_array from datetime64 (#53890)
Browse files Browse the repository at this point in the history
  • Loading branch information
natmokval authored Jun 28, 2023
1 parent 75af60b commit 28a0c65
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pandas/tests/arrays/period/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ def test_from_datetime64_freq_changes():
tm.assert_period_array_equal(result, expected)


def test_from_datetime64_freq_2M():
arr = np.array(
["2020-01-01T00:00:00", "2020-01-02T00:00:00"], dtype="datetime64[ns]"
)
result = PeriodArray._from_datetime64(arr, "2M")
expected = period_array(["2020-01", "2020-01"], freq="2M")
tm.assert_period_array_equal(result, expected)


@pytest.mark.parametrize(
"data, freq, msg",
[
Expand Down

0 comments on commit 28a0c65

Please sign in to comment.