Skip to content

Commit 699d5e5

Browse files
committed
BLD: add locale to 34_nslow build
Author: Jeff Reback <[email protected]> Closes pandas-dev#15211 from jreback/nslow and squashes the following commits: 7dd0fac [Jeff Reback] TST: skip some non-us locale tests with guessing datetimes a7c90e1 [Jeff Reback] BLD: add locale to 34_nslow build
1 parent 74b2b0f commit 699d5e5

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ matrix:
132132
env:
133133
- PYTHON_VERSION=3.4
134134
- JOB_NAME: "34_nslow"
135+
- LOCALE_OVERRIDE="zh_CN.UTF-8"
135136
- NOSE_ARGS="not slow and not disabled"
136137
- FULL_DEPS=true
137138
- CLIPBOARD=xsel
@@ -141,6 +142,7 @@ matrix:
141142
apt:
142143
packages:
143144
- xsel
145+
- language-pack-zh-hans
144146
# In allow_failures
145147
- python: 3.4
146148
env:
@@ -229,6 +231,7 @@ matrix:
229231
env:
230232
- PYTHON_VERSION=3.4
231233
- JOB_NAME: "34_nslow"
234+
- LOCALE_OVERRIDE="zh_CN.UTF-8"
232235
- NOSE_ARGS="not slow and not disabled"
233236
- FULL_DEPS=true
234237
- CLIPBOARD=xsel
@@ -238,6 +241,7 @@ matrix:
238241
apt:
239242
packages:
240243
- xsel
244+
- language-pack-zh-hans
241245
- python: 3.5
242246
env:
243247
- PYTHON_VERSION=3.5

pandas/tseries/tests/test_timeseries.py

+3
Original file line numberDiff line numberDiff line change
@@ -5492,7 +5492,9 @@ def test_to_datetime_iso8601_noleading_0s(self):
54925492

54935493

54945494
class TestGuessDatetimeFormat(tm.TestCase):
5495+
54955496
def test_guess_datetime_format_with_parseable_formats(self):
5497+
tm._skip_if_not_us_locale()
54965498
dt_string_to_format = (('20111230', '%Y%m%d'),
54975499
('2011-12-30', '%Y-%m-%d'),
54985500
('30-12-2011', '%d-%m-%Y'),
@@ -5567,6 +5569,7 @@ def test_guess_datetime_format_nopadding(self):
55675569
)
55685570

55695571
def test_guess_datetime_format_for_array(self):
5572+
tm._skip_if_not_us_locale()
55705573
expected_format = '%Y-%m-%d %H:%M:%S.%f'
55715574
dt_string = datetime(2011, 12, 30, 0, 0, 0).strftime(expected_format)
55725575

pandas/util/testing.py

+8
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,14 @@ def _skip_if_has_locale():
404404
import nose
405405
raise nose.SkipTest("Specific locale is set {0}".format(lang))
406406

407+
408+
def _skip_if_not_us_locale():
409+
import locale
410+
lang, _ = locale.getlocale()
411+
if lang != 'en_US':
412+
import nose
413+
raise nose.SkipTest("Specific locale is set {0}".format(lang))
414+
407415
# -----------------------------------------------------------------------------
408416
# locale utilities
409417

0 commit comments

Comments
 (0)