Pillow/Tests/test_locale.py
Jon Dufresne d50445ff30 Introduce isort to automate import ordering and formatting
Similar to the recent adoption of Black. isort is a Python utility to
sort imports alphabetically and automatically separate into sections. By
using isort, contributors can quickly and automatically conform to the
projects style without thinking. Just let the tool do it.

Uses the configuration recommended by the Black to avoid conflicts of
style.

Rewrite TestImageQt.test_deprecated to no rely on import order.
2019-07-06 16:11:35 -07:00

35 lines
761 B
Python

from __future__ import print_function
import locale
from PIL import Image
from .helper import PillowTestCase, unittest
# ref https://github.com/python-pillow/Pillow/issues/272
# on windows, in polish locale:
# import locale
# print(locale.setlocale(locale.LC_ALL, 'polish'))
# import string
# print(len(string.whitespace))
# print(ord(string.whitespace[6]))
# Polish_Poland.1250
# 7
# 160
# one of string.whitespace is not freely convertable into ascii.
path = "Tests/images/hopper.jpg"
class TestLocale(PillowTestCase):
def test_sanity(self):
Image.open(path)
try:
locale.setlocale(locale.LC_ALL, "polish")
except locale.Error:
unittest.skip("Polish locale not available")
Image.open(path)