Skip to content

Commit 941587a

Browse files
committed
TST: incorrect locale specification for datetime format
closes #15215
1 parent 2619ee3 commit 941587a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/tseries/tests/test_timeseries.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -5369,7 +5369,13 @@ def test_to_datetime_format_integer(self):
53695369
assert_series_equal(result, expected)
53705370

53715371
def test_to_datetime_format_microsecond(self):
5372-
val = '01-Apr-2011 00:00:01.978'
5372+
5373+
# these are locale dependent
5374+
import locale, calendar
5375+
lang, _ = locale.getlocale()
5376+
month_abbr = calendar.month_abbr[4]
5377+
val = '01-{}-2011 00:00:01.978'.format(month_abbr)
5378+
53735379
format = '%d-%b-%Y %H:%M:%S.%f'
53745380
result = to_datetime(val, format=format)
53755381
exp = datetime.strptime(val, format)

0 commit comments

Comments
 (0)