From: Serhiy Storchaka Date: Wed, 16 Jul 2014 20:50:37 +0000 (+0300) Subject: Add helpers for testing unicode disabled builds. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fdfe9fce8ca667bba06b1b1a657f722fd9511562;p=python Add helpers for testing unicode disabled builds. --- diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index e1ee3f537e..695ac9534c 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -498,13 +498,18 @@ PIPE_MAX_SIZE = 4 * 1024 * 1024 + 1 # for a discussion of this number). SOCK_MAX_SIZE = 16 * 1024 * 1024 + 1 +is_jython = sys.platform.startswith('java') + try: unicode have_unicode = True except NameError: have_unicode = False -is_jython = sys.platform.startswith('java') +requires_unicode = unittest.skipUnless(have_unicode, 'no unicode support') + +def u(s): + return unicode(s, 'unicode-escape') # FS_NONASCII: non-ASCII Unicode character encodable by # sys.getfilesystemencoding(), or None if there is no such character.