Commit 64b02e30 authored by Christoph Reiter's avatar Christoph Reiter

tests: remove locale test for uppercasing C names

Someone on IRC had problems running the test suite, and that's not the first
time, so remove it for now (added in 63c7f17c)

The locale generation adds extra dependencies and only works on Linux,
and while the test does something useful it complicates things too much.

We need to find a better way (in Python if possible) to test for locale
dependend upper()/lower().
parent d9516e8d
Pipeline #3177 passed with stage
in 10 minutes and 45 seconds
......@@ -14,6 +14,6 @@ include .gitlab-ci.yml
recursive-include examples *.py *.am *.png *.css *.ui *.gif *.gresource *.jpg *.xml
recursive-include gi *.am *.h
recursive-include pygtkcompat *.am
recursive-include tests *.py *.c *.h *.xml *.supp *nouppera *.am
recursive-include tests *.py *.c *.h *.xml *.supp *.am
recursive-include docs *.rst *.svg LICENSE *.ico *.png *.css *.py *.dia Makefile
recursive-include .gitlab-ci *.sh *.rst Dockerfile
......@@ -112,7 +112,6 @@ EXTRA_DIST = \
test-floating.h \
test-thread.h \
test-unknown.h \
te_ST@nouppera \
org.gnome.test.gschema.xml \
test_cairo.py \
test_error.py \
......
LC_IDENTIFICATION
title "pygobject test locale"
END LC_IDENTIFICATION
LC_COLLATE
copy "POSIX"
END LC_COLLATE
LC_CTYPE
# a → a, other characters normally
toupper (<U0061>,<U0061>); (<U0062>,<U0042>); (<U0063>,<U0043>); \
(<U0076>,<U0056>); (<U006C>,<U004C>); (<U0075>,<U0055>); \
(<U0065>,<U0045>);
END LC_CTYPE
LC_MESSAGES
copy "en_US"
END LC_MESSAGES
LC_MONETARY
copy "en_US"
END LC_MONETARY
LC_NUMERIC
copy "POSIX"
END LC_NUMERIC
LC_TIME
copy "POSIX"
END LC_TIME
LC_PAPER
copy "en_US"
END LC_PAPER
LC_TELEPHONE
copy "en_US"
END LC_TELEPHONE
LC_MEASUREMENT
copy "en_US"
END LC_MEASUREMENT
LC_NAME
copy "en_US"
END LC_NAME
LC_ADDRESS
copy "en_US"
END LC_ADDRESS
......@@ -8,8 +8,6 @@ import unittest
import tempfile
import shutil
import os
import locale
import subprocess
import gc
import weakref
import warnings
......@@ -1658,35 +1656,6 @@ class TestPointer(unittest.TestCase):
class TestEnum(unittest.TestCase):
@classmethod
def setUpClass(cls):
'''Run tests under a test locale.
Upper case conversion of member names should not be locale specific
e. g. in Turkish, "i".upper() == "i", which gives results like "iNVALiD"
Run test under a locale which defines toupper('a') == 'a'
'''
if sys.platform == "darwin" or os.name == "nt":
return
cls.locale_dir = tempfile.mkdtemp()
src = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'te_ST@nouppera')
dest = os.path.join(cls.locale_dir, 'te_ST.UTF-8@nouppera')
subprocess.check_call(['localedef', '-i', src, '-c', '-f', 'UTF-8', dest])
os.environ['LOCPATH'] = cls.locale_dir
locale.setlocale(locale.LC_ALL, 'te_ST.UTF-8@nouppera')
@classmethod
def tearDownClass(cls):
if sys.platform == "darwin" or os.name == "nt":
return
locale.setlocale(locale.LC_ALL, 'C')
shutil.rmtree(cls.locale_dir)
try:
del os.environ['LOCPATH']
except KeyError:
pass
def test_enum(self):
self.assertTrue(issubclass(GIMarshallingTests.Enum, int))
self.assertTrue(isinstance(GIMarshallingTests.Enum.VALUE1, GIMarshallingTests.Enum))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment