Skip to content

Commit 0c8442c

Browse files
authored
TST: incorrect locale specification for datetime format (pandas-dev#15233)
closes pandas-dev#15215
1 parent 2619ee3 commit 0c8442c

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
@@ -1,4 +1,5 @@
11
# pylint: disable-msg=E1101,W0612
2+
import locale
23
import calendar
34
import operator
45
import sys
@@ -5369,7 +5370,12 @@ def test_to_datetime_format_integer(self):
53695370
assert_series_equal(result, expected)
53705371

53715372
def test_to_datetime_format_microsecond(self):
5372-
val = '01-Apr-2011 00:00:01.978'
5373+
5374+
# these are locale dependent
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)