Skip to content

Commit

Permalink
BLD: Test for Python 3.5 with C locale
Browse files Browse the repository at this point in the history
xref #12337

Author: Nicolas Bonnotte <nicolas.bonnotte@gmail.com>

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
  • Loading branch information
nbonnotte authored and jreback committed Sep 10, 2016
1 parent 2672a79 commit 1e61aed
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions ci/requirements-3.5_ASCII.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
python-dateutil
pytz
numpy
cython
3 changes: 3 additions & 0 deletions ci/requirements-3.5_ASCII.run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
python-dateutil
pytz
numpy
4 changes: 2 additions & 2 deletions pandas/tests/formats/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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'],
Expand Down
8 changes: 5 additions & 3 deletions pandas/tools/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1e61aed

Please sign in to comment.