From 4782960f77cff555ff28676ade5b6f4bbabce7f0 Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Wed, 25 Jan 2017 19:20:13 -0500 Subject: [PATCH] TST: incorrect locale specification for datetime format closes #15215 --- pandas/tseries/tests/test_timeseries.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandas/tseries/tests/test_timeseries.py b/pandas/tseries/tests/test_timeseries.py index 4d286fc62764c..b5daf1ac0ec68 100644 --- a/pandas/tseries/tests/test_timeseries.py +++ b/pandas/tseries/tests/test_timeseries.py @@ -1,4 +1,5 @@ # pylint: disable-msg=E1101,W0612 +import locale import calendar import operator import sys @@ -5369,7 +5370,12 @@ def test_to_datetime_format_integer(self): assert_series_equal(result, expected) def test_to_datetime_format_microsecond(self): - val = '01-Apr-2011 00:00:01.978' + + # these are locale dependent + lang, _ = locale.getlocale() + month_abbr = calendar.month_abbr[4] + val = '01-{}-2011 00:00:01.978'.format(month_abbr) + format = '%d-%b-%Y %H:%M:%S.%f' result = to_datetime(val, format=format) exp = datetime.strptime(val, format)