From 9ba1f12daf234ff12fd0458a5ce415ec73a50859 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Tue, 31 Jan 2017 20:41:24 -0600 Subject: [PATCH] TST: Skip if getlocale is None On some travis runs, `locale.getlocale()` returned (None, None). When the `tm.set_locale` context manager exists, we set it to `locale.getlocale(locale.LC_ALL, None)`, which defauls to utf-8, so when we compare afterwards, we get a failure. --- pandas/tools/tests/test_util.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandas/tools/tests/test_util.py b/pandas/tools/tests/test_util.py index e1d057eb3c3c0..0716a13fac3fe 100644 --- a/pandas/tools/tests/test_util.py +++ b/pandas/tools/tests/test_util.py @@ -93,6 +93,11 @@ def test_set_locale(self): raise nose.SkipTest("Only a single locale found, no point in " "trying to test setting another locale") + if all(x is None for x in CURRENT_LOCALE): + # Not sure why, but on some travis runs with pytest, + # getlocale() returned (None, None). + raise nose.SkipTest("CURRENT_LOCALE is not set.") + if LOCALE_OVERRIDE is None: lang, enc = 'it_CH', 'UTF-8' elif LOCALE_OVERRIDE == 'C':