diff --git a/.travis.yml b/.travis.yml index b2a1a8a63cfe6..be2058950d8ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -132,6 +132,7 @@ matrix: env: - PYTHON_VERSION=3.4 - JOB_NAME: "34_nslow" + - LOCALE_OVERRIDE="zh_CN.UTF-8" - NOSE_ARGS="not slow and not disabled" - FULL_DEPS=true - CLIPBOARD=xsel @@ -141,6 +142,7 @@ matrix: apt: packages: - xsel + - language-pack-zh-hans # In allow_failures - python: 3.4 env: @@ -229,6 +231,7 @@ matrix: env: - PYTHON_VERSION=3.4 - JOB_NAME: "34_nslow" + - LOCALE_OVERRIDE="zh_CN.UTF-8" - NOSE_ARGS="not slow and not disabled" - FULL_DEPS=true - CLIPBOARD=xsel @@ -238,6 +241,7 @@ matrix: apt: packages: - xsel + - language-pack-zh-hans - python: 3.5 env: - PYTHON_VERSION=3.5 diff --git a/pandas/tseries/tests/test_timeseries.py b/pandas/tseries/tests/test_timeseries.py index 704aebd815a29..4d286fc62764c 100644 --- a/pandas/tseries/tests/test_timeseries.py +++ b/pandas/tseries/tests/test_timeseries.py @@ -5492,7 +5492,9 @@ def test_to_datetime_iso8601_noleading_0s(self): class TestGuessDatetimeFormat(tm.TestCase): + def test_guess_datetime_format_with_parseable_formats(self): + tm._skip_if_not_us_locale() dt_string_to_format = (('20111230', '%Y%m%d'), ('2011-12-30', '%Y-%m-%d'), ('30-12-2011', '%d-%m-%Y'), @@ -5567,6 +5569,7 @@ def test_guess_datetime_format_nopadding(self): ) def test_guess_datetime_format_for_array(self): + tm._skip_if_not_us_locale() expected_format = '%Y-%m-%d %H:%M:%S.%f' dt_string = datetime(2011, 12, 30, 0, 0, 0).strftime(expected_format) diff --git a/pandas/util/testing.py b/pandas/util/testing.py index d39ce7acf0029..6ea91543677a7 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -404,6 +404,14 @@ def _skip_if_has_locale(): import nose raise nose.SkipTest("Specific locale is set {0}".format(lang)) + +def _skip_if_not_us_locale(): + import locale + lang, _ = locale.getlocale() + if lang != 'en_US': + import nose + raise nose.SkipTest("Specific locale is set {0}".format(lang)) + # ----------------------------------------------------------------------------- # locale utilities