mirror of https://github.com/python/cpython
Silence DeprecationWarnings in test_unicode.
This commit is contained in:
parent
795c10b3b6
commit
51e243f22e
|
@ -2172,15 +2172,17 @@ class UnicodeTest(string_tests.CommonTest,
|
|||
# generate a fresh string (refcount=1)
|
||||
text = 'a' * length + 'b'
|
||||
|
||||
# fill wstr internal field
|
||||
abc = text.encode('unicode_internal')
|
||||
self.assertEqual(abc.decode('unicode_internal'), text)
|
||||
with support.check_warnings(('unicode_internal codec has been '
|
||||
'deprecated', DeprecationWarning)):
|
||||
# fill wstr internal field
|
||||
abc = text.encode('unicode_internal')
|
||||
self.assertEqual(abc.decode('unicode_internal'), text)
|
||||
|
||||
# resize text: wstr field must be cleared and then recomputed
|
||||
text += 'c'
|
||||
abcdef = text.encode('unicode_internal')
|
||||
self.assertNotEqual(abc, abcdef)
|
||||
self.assertEqual(abcdef.decode('unicode_internal'), text)
|
||||
# resize text: wstr field must be cleared and then recomputed
|
||||
text += 'c'
|
||||
abcdef = text.encode('unicode_internal')
|
||||
self.assertNotEqual(abc, abcdef)
|
||||
self.assertEqual(abcdef.decode('unicode_internal'), text)
|
||||
|
||||
|
||||
class StringModuleTest(unittest.TestCase):
|
||||
|
|
Loading…
Reference in New Issue