File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2196,15 +2196,17 @@ def test_resize(self):
21962196 # generate a fresh string (refcount=1)
21972197 text = 'a' * length + 'b'
21982198
2199- # fill wstr internal field
2200- abc = text .encode ('unicode_internal' )
2201- self .assertEqual (abc .decode ('unicode_internal' ), text )
2202-
2203- # resize text: wstr field must be cleared and then recomputed
2204- text += 'c'
2205- abcdef = text .encode ('unicode_internal' )
2206- self .assertNotEqual (abc , abcdef )
2207- self .assertEqual (abcdef .decode ('unicode_internal' ), text )
2199+ with support .check_warnings (('unicode_internal codec has been '
2200+ 'deprecated' , DeprecationWarning )):
2201+ # fill wstr internal field
2202+ abc = text .encode ('unicode_internal' )
2203+ self .assertEqual (abc .decode ('unicode_internal' ), text )
2204+
2205+ # resize text: wstr field must be cleared and then recomputed
2206+ text += 'c'
2207+ abcdef = text .encode ('unicode_internal' )
2208+ self .assertNotEqual (abc , abcdef )
2209+ self .assertEqual (abcdef .decode ('unicode_internal' ), text )
22082210
22092211
22102212class StringModuleTest (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments