Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel committed Nov 27, 2023
1 parent 69d3c66 commit 12e57cf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pandas/tests/test_algos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,11 +1260,17 @@ def test_value_counts_datetime_outofbounds(self, dtype):
],
dtype=dtype,
)
res = ser.value_counts()

warn = FutureWarning if dtype == object else None
msg = "The behavior of value_counts with object-dtype is deprecated"
with tm.assert_produces_warning(warn, match=msg):
res = ser.value_counts()

exp_index = Index(
[datetime(3000, 1, 1), datetime(5000, 1, 1), datetime(6000, 1, 1)],
dtype=dtype,
# TODO(3.0): once the value_counts inference deprecation is enforced,
# this will be `dtype=dtype`
dtype="M8[us]",
)
exp = Series([3, 2, 1], index=exp_index, name="count")
tm.assert_series_equal(res, exp)
Expand Down

0 comments on commit 12e57cf

Please sign in to comment.