Skip to content

Commit 9ba1f12

Browse files
committed
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.
1 parent 14c447c commit 9ba1f12

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pandas/tools/tests/test_util.py

+5
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ def test_set_locale(self):
9393
raise nose.SkipTest("Only a single locale found, no point in "
9494
"trying to test setting another locale")
9595

96+
if all(x is None for x in CURRENT_LOCALE):
97+
# Not sure why, but on some travis runs with pytest,
98+
# getlocale() returned (None, None).
99+
raise nose.SkipTest("CURRENT_LOCALE is not set.")
100+
96101
if LOCALE_OVERRIDE is None:
97102
lang, enc = 'it_CH', 'UTF-8'
98103
elif LOCALE_OVERRIDE == 'C':

0 commit comments

Comments
 (0)