mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
4de5477b61
With the introduction and use of pytest, it is simple and easy to execute specific tests in isolation through documented command line arguments. Either by specifying the module path or through the `-k EXPRESSION` argument. There is no longer any need to provide the boilerplate: if __name__ == '__main__': unittest.main() To every test file. It is simply noise. The pattern remains in test files that aren't named with `test_*` as those files are not discovered and executed by pytest by default.
35 lines
761 B
Python
35 lines
761 B
Python
from __future__ import print_function
|
|
from .helper import unittest, PillowTestCase
|
|
|
|
from PIL import Image
|
|
|
|
import locale
|
|
|
|
# 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)
|