mirror of
https://github.com/python/cpython.git
synced 2025-12-04 16:43:27 +00:00
Fix indentation and add a skip decorator.
This commit is contained in:
parent
93e7afc5d9
commit
a5c92b4714
1 changed files with 28 additions and 24 deletions
|
|
@ -13,6 +13,10 @@ import warnings
|
||||||
from test import support, string_tests
|
from test import support, string_tests
|
||||||
import _string
|
import _string
|
||||||
|
|
||||||
|
# decorator to skip tests on narrow builds
|
||||||
|
requires_wide_build = unittest.skipIf(sys.maxunicode == 65535,
|
||||||
|
'requires wide build')
|
||||||
|
|
||||||
# Error handling (bad decoder return)
|
# Error handling (bad decoder return)
|
||||||
def search_function(encoding):
|
def search_function(encoding):
|
||||||
def decode1(input, errors="strict"):
|
def decode1(input, errors="strict"):
|
||||||
|
|
@ -515,7 +519,7 @@ class UnicodeTest(string_tests.CommonTest,
|
||||||
self.assertFalse(meth(s), '%a.%s() is False' % (s, meth_name))
|
self.assertFalse(meth(s), '%a.%s() is False' % (s, meth_name))
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipIf(sys.maxunicode == 65535, 'test requires wide build')
|
@requires_wide_build
|
||||||
def test_lower(self):
|
def test_lower(self):
|
||||||
string_tests.CommonTest.test_lower(self)
|
string_tests.CommonTest.test_lower(self)
|
||||||
self.assertEqual('\U00010427'.lower(), '\U0001044F')
|
self.assertEqual('\U00010427'.lower(), '\U0001044F')
|
||||||
|
|
@ -526,7 +530,7 @@ class UnicodeTest(string_tests.CommonTest,
|
||||||
self.assertEqual('X\U00010427x\U0001044F'.lower(),
|
self.assertEqual('X\U00010427x\U0001044F'.lower(),
|
||||||
'x\U0001044Fx\U0001044F')
|
'x\U0001044Fx\U0001044F')
|
||||||
|
|
||||||
@unittest.skipIf(sys.maxunicode == 65535, 'test requires wide build')
|
@requires_wide_build
|
||||||
def test_upper(self):
|
def test_upper(self):
|
||||||
string_tests.CommonTest.test_upper(self)
|
string_tests.CommonTest.test_upper(self)
|
||||||
self.assertEqual('\U0001044F'.upper(), '\U00010427')
|
self.assertEqual('\U0001044F'.upper(), '\U00010427')
|
||||||
|
|
@ -537,7 +541,7 @@ class UnicodeTest(string_tests.CommonTest,
|
||||||
self.assertEqual('X\U00010427x\U0001044F'.upper(),
|
self.assertEqual('X\U00010427x\U0001044F'.upper(),
|
||||||
'X\U00010427X\U00010427')
|
'X\U00010427X\U00010427')
|
||||||
|
|
||||||
@unittest.skipIf(sys.maxunicode == 65535, 'test requires wide build')
|
@requires_wide_build
|
||||||
def test_capitalize(self):
|
def test_capitalize(self):
|
||||||
string_tests.CommonTest.test_capitalize(self)
|
string_tests.CommonTest.test_capitalize(self)
|
||||||
self.assertEqual('\U0001044F'.capitalize(), '\U00010427')
|
self.assertEqual('\U0001044F'.capitalize(), '\U00010427')
|
||||||
|
|
@ -550,7 +554,7 @@ class UnicodeTest(string_tests.CommonTest,
|
||||||
self.assertEqual('X\U00010427x\U0001044F'.capitalize(),
|
self.assertEqual('X\U00010427x\U0001044F'.capitalize(),
|
||||||
'X\U0001044Fx\U0001044F')
|
'X\U0001044Fx\U0001044F')
|
||||||
|
|
||||||
@unittest.skipIf(sys.maxunicode == 65535, 'test requires wide build')
|
@requires_wide_build
|
||||||
def test_title(self):
|
def test_title(self):
|
||||||
string_tests.MixinStrUnicodeUserStringTest.test_title(self)
|
string_tests.MixinStrUnicodeUserStringTest.test_title(self)
|
||||||
self.assertEqual('\U0001044F'.title(), '\U00010427')
|
self.assertEqual('\U0001044F'.title(), '\U00010427')
|
||||||
|
|
@ -565,7 +569,7 @@ class UnicodeTest(string_tests.CommonTest,
|
||||||
self.assertEqual('X\U00010427x\U0001044F X\U00010427x\U0001044F'.title(),
|
self.assertEqual('X\U00010427x\U0001044F X\U00010427x\U0001044F'.title(),
|
||||||
'X\U0001044Fx\U0001044F X\U0001044Fx\U0001044F')
|
'X\U0001044Fx\U0001044F X\U0001044Fx\U0001044F')
|
||||||
|
|
||||||
@unittest.skipIf(sys.maxunicode == 65535, 'test requires wide build')
|
@requires_wide_build
|
||||||
def test_swapcase(self):
|
def test_swapcase(self):
|
||||||
string_tests.CommonTest.test_swapcase(self)
|
string_tests.CommonTest.test_swapcase(self)
|
||||||
self.assertEqual('\U0001044F'.swapcase(), '\U00010427')
|
self.assertEqual('\U0001044F'.swapcase(), '\U00010427')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue