Skip to content

Commit

Permalink
TST: Skip if getlocale is None
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TomAugspurger committed Feb 10, 2017
1 parent 14c447c commit 9ba1f12
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pandas/tools/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit 9ba1f12

Please sign in to comment.