Example #1
0
    def test_locale(self):
        if sys.platform == 'win32':
            raise nose.SkipTest("skipping on win platforms as locale not available")

        #GH9744
        locales = tm.get_locales()
        self.assertTrue(len(locales) >= 1)
Example #2
0
    def setup_class(cls):
        cls.locales = tm.get_locales()

        if not cls.locales:
            pytest.skip("No locales found")

        tm._skip_if_windows()
Example #3
0
    def test_locale(self):
        if sys.platform == 'win32':
            pytest.skip(
                "skipping on win platforms as locale not available")

        # GH9744
        locales = tm.get_locales()
        assert len(locales) >= 1
Example #4
0
    def setUpClass(cls):
        super(TestLocaleUtils, cls).setUpClass()
        cls.locales = tm.get_locales()

        if not cls.locales:
            raise nose.SkipTest("No locales found")

        tm._skip_if_windows()
Example #5
0
    def setUpClass(cls):
        super(TestLocaleUtils, cls).setUpClass()
        cls.locales = tm.get_locales()

        if not cls.locales:
            pytest.skip("No locales found")

        tm._skip_if_windows()
Example #6
0
    def setUpClass(cls):
        cls.locales = tm.get_locales()

        if not cls.locales:
            raise nose.SkipTest("No locales found")

        if os.name == 'nt':  # we're on windows
            raise nose.SkipTest("Running on Windows")
Example #7
0
 def test_get_locales_prefix(self):
     if len(self.locales) == 1:
         pytest.skip("Only a single locale found, no point in "
                     "trying to test filtering locale prefixes")
     first_locale = self.locales[0]
     assert len(tm.get_locales(prefix=first_locale[:2])) > 0
Example #8
0
 def test_get_locales(self):
     # all systems should have at least a single locale
     assert len(tm.get_locales()) > 0
Example #9
0
 def setUpClass(cls):
     super(TestGoogle, cls).setUpClass()
     cls.locales = tm.get_locales(prefix='en_US')
     if not cls.locales:
         raise nose.SkipTest("US English locale not available for testing")
Example #10
0
    def setup_class(cls):
        cls.locales = tm.get_locales()
        cls.current_locale = locale.getlocale()

        if not cls.locales:
            pytest.skip("No locales found")
Example #11
0
def test_get_locales_prefix():
    first_locale = _all_locales[0]
    assert len(tm.get_locales(prefix=first_locale[:2])) > 0
Example #12
0
# -*- coding: utf-8 -*-
import codecs
import locale
import os

import pytest

from pandas._config.localization import can_set_locale, set_locale

from pandas.compat import is_platform_windows

# TODO: move get_locales into localization, making `tm` import unnecessary.
#  This is blocked by the need for core.config to be moved to _config.
import pandas.util.testing as tm

_all_locales = tm.get_locales() or []
_current_locale = locale.getlocale()

# Don't run any of these tests if we are on Windows or have no locales.
pytestmark = pytest.mark.skipif(is_platform_windows() or not _all_locales,
                                reason="Need non-Windows and locales")

_skip_if_only_one_locale = pytest.mark.skipif(
    len(_all_locales) <= 1, reason="Need multiple locales for meaningful test")


def test_can_set_locale_valid_set():
    # Can set the default locale.
    assert can_set_locale("")