From 1e61aed165385a9e302ff1afea7eb01bd8bd7ecf Mon Sep 17 00:00:00 2001 From: Nicolas Bonnotte Date: Sat, 10 Sep 2016 10:37:00 -0400 Subject: [PATCH] BLD: Test for Python 3.5 with C locale xref #12337 Author: Nicolas Bonnotte Closes #14114 from nbonnotte/unicode-to_latex-12337 and squashes the following commits: dadf73c [Nicolas Bonnotte] New tentative with C locale b876296 [Nicolas Bonnotte] Base matrix configuration c825f86 [Nicolas Bonnotte] New files requirements-3.5_ASCII.* 3b4c6a5 [Nicolas Bonnotte] Travis conf: new test with python 3.5 and LC_ALL=C 3b859ce [Nicolas Bonnotte] Test for Python 3.4 with C locale --- .travis.yml | 17 +++++++++++++++++ ci/requirements-3.5_ASCII.build | 4 ++++ ci/requirements-3.5_ASCII.run | 3 +++ pandas/tests/formats/test_format.py | 4 ++-- pandas/tools/tests/test_util.py | 8 +++++--- 5 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 ci/requirements-3.5_ASCII.build create mode 100644 ci/requirements-3.5_ASCII.run diff --git a/.travis.yml b/.travis.yml index c6f6d8b81ae59..4eefd6ca83694 100644 --- a/.travis.yml +++ b/.travis.yml @@ -153,6 +153,15 @@ matrix: apt: packages: - language-pack-it +# In allow_failures + - python: 3.5 + env: + - JOB_NAME: "35_ascii" + - JOB_TAG=_ASCII + - NOSE_ARGS="not slow and not network and not disabled" + - LOCALE_OVERRIDE="C" + - CACHE_NAME="35_ascii" + - USE_CACHE=true # In allow_failures - python: 2.7 env: @@ -219,6 +228,14 @@ matrix: apt: packages: - language-pack-it + - python: 3.5 + env: + - JOB_NAME: "35_ascii" + - JOB_TAG=_ASCII + - NOSE_ARGS="not slow and not network and not disabled" + - LOCALE_OVERRIDE="C" + - CACHE_NAME="35_ascii" + - USE_CACHE=true - python: 2.7 env: - JOB_NAME: "doc_build" diff --git a/ci/requirements-3.5_ASCII.build b/ci/requirements-3.5_ASCII.build new file mode 100644 index 0000000000000..9558cf00ddf5c --- /dev/null +++ b/ci/requirements-3.5_ASCII.build @@ -0,0 +1,4 @@ +python-dateutil +pytz +numpy +cython diff --git a/ci/requirements-3.5_ASCII.run b/ci/requirements-3.5_ASCII.run new file mode 100644 index 0000000000000..b9d543f557d06 --- /dev/null +++ b/ci/requirements-3.5_ASCII.run @@ -0,0 +1,3 @@ +python-dateutil +pytz +numpy diff --git a/pandas/tests/formats/test_format.py b/pandas/tests/formats/test_format.py index 7e55c04fec7cc..ba7ad55a081cd 100644 --- a/pandas/tests/formats/test_format.py +++ b/pandas/tests/formats/test_format.py @@ -2820,7 +2820,7 @@ def test_to_latex_filename(self): self.assertEqual(df.to_latex(), f.read()) # test with utf-8 without encoding option - if compat.PY3: # python3 default encoding is utf-8 + if compat.PY3: # python3: pandas default encoding is utf-8 with tm.ensure_clean('test.tex') as path: df.to_latex(path) with codecs.open(path, 'r') as f: @@ -4295,7 +4295,7 @@ def format_func(x): formatter = fmt.Datetime64Formatter(x, formatter=format_func) result = formatter.get_result() self.assertEqual(result, ['2016-01', '2016-02']) - + def test_datetime64formatter_hoursecond(self): x = Series(pd.to_datetime(['10:10:10.100', '12:12:12.120'], diff --git a/pandas/tools/tests/test_util.py b/pandas/tools/tests/test_util.py index 7532997ef9d8e..d8a98bbb3fd27 100644 --- a/pandas/tools/tests/test_util.py +++ b/pandas/tools/tests/test_util.py @@ -68,10 +68,12 @@ def test_set_locale(self): raise nose.SkipTest("Only a single locale found, no point in " "trying to test setting another locale") - if LOCALE_OVERRIDE is not None: - lang, enc = LOCALE_OVERRIDE.split('.') - else: + if LOCALE_OVERRIDE is None: lang, enc = 'it_CH', 'UTF-8' + elif LOCALE_OVERRIDE == 'C': + lang, enc = 'en_US', 'ascii' + else: + lang, enc = LOCALE_OVERRIDE.split('.') enc = codecs.lookup(enc).name new_locale = lang, enc