[Python-checkins] cpython (3.3): Silence DeprecationWarnings in test_unicode.
ezio.melotti
python-checkins at python.org
Wed Feb 20 23:01:57 CET 2013
http://hg.python.org/cpython/rev/7f34f8fa799d
changeset: 82285:7f34f8fa799d
branch: 3.3
parent: 82280:9d00c79b27e1
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Wed Feb 20 23:56:01 2013 +0200
summary:
Silence DeprecationWarnings in test_unicode.
files:
Lib/test/test_unicode.py | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -2172,15 +2172,17 @@
# 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):
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list