Skip to content

BLD: add locale to 34_nslow build #15211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -141,6 +142,7 @@ matrix:
apt:
packages:
- xsel
- language-pack-zh-hans
# In allow_failures
- python: 3.4
env:
Expand Down Expand Up @@ -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
Expand All @@ -238,6 +241,7 @@ matrix:
apt:
packages:
- xsel
- language-pack-zh-hans
- python: 3.5
env:
- PYTHON_VERSION=3.5
Expand Down
3 changes: 3 additions & 0 deletions pandas/tseries/tests/test_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -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)

Expand Down
8 changes: 8 additions & 0 deletions pandas/util/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down