Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b13a7c1

Browse files
committedMay 26, 2018
Fix tests for day_name and month_name change
1 parent 554c771 commit b13a7c1

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed
 

‎.coverage.Inspiron-3521.21561.440268

-1
This file was deleted.

‎pandas/tests/indexes/datetimes/test_misc.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pandas as pd
88
import pandas.util.testing as tm
99
from pandas import (Index, DatetimeIndex, datetime, offsets,
10-
date_range, Timestamp)
10+
date_range, Timestamp, CategoricalIndex)
1111

1212

1313
class TestTimeSeries(object):
@@ -283,7 +283,9 @@ def test_datetime_name_accessors(self, time_locale):
283283
# GH 12805
284284
dti = DatetimeIndex(freq='M', start='2012', end='2013')
285285
result = dti.month_name(locale=time_locale)
286-
expected = Index([month.capitalize() for month in expected_months])
286+
expected = CategoricalIndex(
287+
[month.capitalize() for month in expected_months],
288+
ordered=True, categories=expected_months)
287289
tm.assert_index_equal(result, expected)
288290
for date, expected in zip(dti, expected_months):
289291
result = date.month_name(locale=time_locale)

‎pandas/tests/series/test_datetime_values.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ def test_dt_accessor_datetime_name_accessors(self, time_locale):
308308

309309
s = Series(DatetimeIndex(freq='M', start='2012', end='2013'))
310310
result = s.dt.month_name(locale=time_locale)
311-
expected = Series([month.capitalize() for month in expected_months])
311+
expected = Series([month.capitalize() for month in expected_months])\
312+
.astype('category', ordered=True, categories=expected_months)
312313
tm.assert_series_equal(result, expected)
313314
for s_date, expected in zip(s, expected_months):
314315
result = s_date.month_name(locale=time_locale)

‎test_script.py

-5
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.