mirror of
https://github.com/python/cpython.git
synced 2025-11-13 23:46:24 +00:00
Merge DeprecationWarnings silencing in test_unicode from 3.3.
This commit is contained in:
commit
09d9d0f385
1 changed files with 10 additions and 8 deletions
|
|
@ -2196,15 +2196,17 @@ class UnicodeTest(string_tests.CommonTest,
|
||||||
# generate a fresh string (refcount=1)
|
# generate a fresh string (refcount=1)
|
||||||
text = 'a' * length + 'b'
|
text = 'a' * length + 'b'
|
||||||
|
|
||||||
# fill wstr internal field
|
with support.check_warnings(('unicode_internal codec has been '
|
||||||
abc = text.encode('unicode_internal')
|
'deprecated', DeprecationWarning)):
|
||||||
self.assertEqual(abc.decode('unicode_internal'), text)
|
# 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
|
# resize text: wstr field must be cleared and then recomputed
|
||||||
text += 'c'
|
text += 'c'
|
||||||
abcdef = text.encode('unicode_internal')
|
abcdef = text.encode('unicode_internal')
|
||||||
self.assertNotEqual(abc, abcdef)
|
self.assertNotEqual(abc, abcdef)
|
||||||
self.assertEqual(abcdef.decode('unicode_internal'), text)
|
self.assertEqual(abcdef.decode('unicode_internal'), text)
|
||||||
|
|
||||||
|
|
||||||
class StringModuleTest(unittest.TestCase):
|
class StringModuleTest(unittest.TestCase):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue